diff options
Diffstat (limited to 'zebra/ioctl.c')
-rw-r--r-- | zebra/ioctl.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/zebra/ioctl.c b/zebra/ioctl.c index f8e7f22b..3e5d1d2f 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -27,13 +27,10 @@ #include "prefix.h" #include "ioctl.h" #include "log.h" -#include "privs.h" #include "zebra/rib.h" #include "zebra/rt.h" -extern struct zebra_privs_t zserv_privs; - /* clear and set interface name string */ void ifreq_set_name (struct ifreq *ifreq, struct interface *ifp) @@ -49,19 +46,14 @@ if_ioctl (u_long request, caddr_t buffer) int ret = 0; int err = 0; - if (zserv_privs.change(ZPRIVS_RAISE)) - zlog (NULL, LOG_ERR, "Can't raise privileges"); sock = socket (AF_INET, SOCK_DGRAM, 0); if (sock < 0) { - if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); perror ("socket"); exit (1); } + ret = ioctl (sock, request, buffer); - if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); if (ret < 0) { err = errno; @@ -84,21 +76,14 @@ if_ioctl_ipv6 (u_long request, caddr_t buffer) int ret = 0; int err = 0; - if (zserv_privs.change(ZPRIVS_RAISE)) - zlog (NULL, LOG_ERR, "Can't raise privileges"); sock = socket (AF_INET6, SOCK_DGRAM, 0); if (sock < 0) { - if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); perror ("socket"); exit (1); } ret = ioctl (sock, request, buffer); - if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); - if (ret < 0) { err = errno; |