summaryrefslogtreecommitdiffstats
path: root/vrrpd/vrrp.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-08-13 15:47:23 +0200
committerDavid Lamparter <equinox@diac24.net>2019-09-03 17:18:35 +0200
commit0cf6db21eca516d825431d4a747748a94c890aad (patch)
tree9cd6d2fa6df5f91024a4edc160d4c759bd93d942 /vrrpd/vrrp.c
parenttools: extend checkpatch.pl for frr_{with,each} (diff)
downloadfrr-0cf6db21eca516d825431d4a747748a94c890aad.tar.xz
frr-0cf6db21eca516d825431d4a747748a94c890aad.zip
*: frr_elevate_privs -> frr_with_privs
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'vrrpd/vrrp.c')
-rw-r--r--vrrpd/vrrp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index 951ad3f58..b4049b55e 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -1065,8 +1065,7 @@ static int vrrp_socket(struct vrrp_router *r)
int ret;
bool failed = false;
- frr_elevate_privs(&vrrp_privs)
- {
+ frr_with_privs(&vrrp_privs) {
r->sock_rx = socket(r->family, SOCK_RAW, IPPROTO_VRRP);
r->sock_tx = socket(r->family, SOCK_RAW, IPPROTO_VRRP);
}
@@ -1102,8 +1101,7 @@ static int vrrp_socket(struct vrrp_router *r)
setsockopt_ipv4_multicast_loop(r->sock_tx, 0);
/* Bind Rx socket to exact interface */
- frr_elevate_privs(&vrrp_privs)
- {
+ frr_with_privs(&vrrp_privs) {
ret = setsockopt(r->sock_rx, SOL_SOCKET,
SO_BINDTODEVICE, r->vr->ifp->name,
strlen(r->vr->ifp->name));
@@ -1213,8 +1211,7 @@ static int vrrp_socket(struct vrrp_router *r)
setsockopt_ipv6_multicast_loop(r->sock_tx, 0);
/* Bind Rx socket to exact interface */
- frr_elevate_privs(&vrrp_privs)
- {
+ frr_with_privs(&vrrp_privs) {
ret = setsockopt(r->sock_rx, SOL_SOCKET,
SO_BINDTODEVICE, r->vr->ifp->name,
strlen(r->vr->ifp->name));