summaryrefslogtreecommitdiffstats
path: root/vrrpd
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-04-20 02:41:30 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 02:27:08 +0200
commitc94d18955e8a1e239c063c62ddde00559c91840c (patch)
treecd6eece075ce45414a77fdc7b715cf14076b8ac0 /vrrpd
parentdoc: add VRRP documentation (diff)
downloadfrr-c94d18955e8a1e239c063c62ddde00559c91840c.tar.xz
frr-c94d18955e8a1e239c063c62ddde00559c91840c.zip
vrrpd: use frr_elevate_privs
Missed a few in the uplift. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd')
-rw-r--r--vrrpd/vrrp.c6
-rw-r--r--vrrpd/vrrp_ndisc.c3
2 files changed, 3 insertions, 6 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index d24f918b1..f98b230c6 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -1087,13 +1087,12 @@ static int vrrp_socket(struct vrrp_router *r)
setsockopt_ipv4_multicast_loop(r->sock_tx, 0);
/* Bind Rx socket to exact interface */
- vrrp_privs.change(ZPRIVS_RAISE);
+ frr_elevate_privs(&vrrp_privs)
{
ret = setsockopt(r->sock_rx, SOL_SOCKET,
SO_BINDTODEVICE, r->vr->ifp->name,
strlen(r->vr->ifp->name));
}
- vrrp_privs.change(ZPRIVS_LOWER);
if (ret) {
zlog_warn(VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
"Failed to bind Rx socket to %s: %s",
@@ -1198,13 +1197,12 @@ static int vrrp_socket(struct vrrp_router *r)
setsockopt_ipv6_multicast_loop(r->sock_tx, 0);
/* Bind Rx socket to exact interface */
- vrrp_privs.change(ZPRIVS_RAISE);
+ frr_elevate_privs(&vrrp_privs)
{
ret = setsockopt(r->sock_rx, SOL_SOCKET,
SO_BINDTODEVICE, r->vr->ifp->name,
strlen(r->vr->ifp->name));
}
- vrrp_privs.change(ZPRIVS_LOWER);
if (ret) {
zlog_warn(VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
"Failed to bind Rx socket to %s: %s",
diff --git a/vrrpd/vrrp_ndisc.c b/vrrpd/vrrp_ndisc.c
index 8a439e97c..8081533eb 100644
--- a/vrrpd/vrrp_ndisc.c
+++ b/vrrpd/vrrp_ndisc.c
@@ -211,11 +211,10 @@ int vrrp_ndisc_una_send_all(struct vrrp_router *r)
void vrrp_ndisc_init(void)
{
- vrrp_privs.change(ZPRIVS_RAISE);
+ frr_elevate_privs(&vrrp_privs)
{
ndisc_fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_IPV6));
}
- vrrp_privs.change(ZPRIVS_LOWER);
if (ndisc_fd > 0) {
DEBUGD(&vrrp_dbg_sock,