summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhasso <hasso>2004-08-06 08:41:56 +0000
committerhasso <hasso>2004-08-06 08:41:56 +0000
commit55e7ecd114cd4f29b529f00cc1fe5d02d0f5b34f (patch)
treee65ae0c8960e86748d04daf66dd1dce3eb43dc70
parent75ee0b8eed29619b98c67dcb5f6b10e1c8f201ae (diff)
Remove pointless privilege lower call. Thanks to Cougar for noticing.
-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);