summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 26369dd8..2ca0de43 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -122,19 +122,17 @@ netlink_socket (struct nlsock *nl, unsigned long groups)
}
ret = bind (sock, (struct sockaddr *) &snl, sizeof snl);
+ if (zserv_privs.change (ZPRIVS_LOWER))
+ zlog (NULL, LOG_ERR, "Can't lower privileges");
+
if (ret < 0)
{
- if (zserv_privs.change (ZPRIVS_LOWER))
- zlog (NULL, LOG_ERR, "Can't lower privileges");
zlog (NULL, LOG_ERR, "Can't bind %s socket to group 0x%x: %s",
nl->name, snl.nl_groups, strerror (errno));
close (sock);
return -1;
}
- if (zserv_privs.change (ZPRIVS_LOWER))
- zlog (NULL, LOG_ERR, "Can't lower privileges");
-
/* multiple netlink sockets will have different nl_pid */
namelen = sizeof snl;
ret = getsockname (sock, (struct sockaddr *) &snl, &namelen);