diff options
author | hasso <hasso> | 2004-08-06 08:41:56 +0000 |
---|---|---|
committer | hasso <hasso> | 2004-08-06 08:41:56 +0000 |
commit | 9ed1cae3da652db73f0c8a4d7640c2b1ffec5c7a (patch) | |
tree | f11bb43efbc437bba0955188def1df89614a0b40 /zebra/rt_netlink.c | |
parent | a40fffde5a547dd74ad220f5d2ac877b37e5e973 (diff) | |
download | quagga-9ed1cae3da652db73f0c8a4d7640c2b1ffec5c7a.tar.bz2 quagga-9ed1cae3da652db73f0c8a4d7640c2b1ffec5c7a.tar.xz |
Remove pointless privilege lower call. Thanks to Cougar for noticing.
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r-- | zebra/rt_netlink.c | 8 |
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); |