From 48a46fa0c35f8f46e482ed1fef8b4bf63e413e0a Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 11 May 2004 10:55:22 +0000 Subject: 2004-05-11 Paul Jakma * Makefile.am: support for IOCTL_METHOD, as per Sowmini's patch. * if_ioctl_solaris.c: Fixup some erroneous privilege changes and add privs.h header. * ioctl_solaris.c: ditto --- zebra/if_ioctl_solaris.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'zebra/if_ioctl_solaris.c') diff --git a/zebra/if_ioctl_solaris.c b/zebra/if_ioctl_solaris.c index b07580c22..9441abed8 100644 --- a/zebra/if_ioctl_solaris.c +++ b/zebra/if_ioctl_solaris.c @@ -29,13 +29,14 @@ #include "connected.h" #include "memory.h" #include "log.h" +#include "privs.h" #include "zebra/interface.h" void lifreq_set_name (struct lifreq *, struct interface *); static int if_get_addr (struct interface *, struct sockaddr *); static void interface_info_ioctl (struct interface *); - +extern struct zebra_privs_t zserv_privs; int interface_list_ioctl (int af) @@ -161,9 +162,6 @@ if_get_index (struct interface *ifp) lifreq_set_name (&lifreq, ifp); - if (zserv_privs.change(ZPRIVS_RAISE)) - zlog (NULL, LOG_ERR, "Can't raise privileges"); - if (ifp->flags & IFF_IPV4) ret = AF_IOCTL (AF_INET, SIOCGLIFINDEX, (caddr_t) & lifreq); else if (ifp->flags & IFF_IPV6) @@ -171,9 +169,6 @@ if_get_index (struct interface *ifp) else ret = -1; - if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); - if (ret < 0) { zlog_warn ("SIOCGLIFINDEX(%s) failed", ifp->name); @@ -221,13 +216,7 @@ if_get_addr (struct interface *ifp, struct sockaddr *addr) if (ifp->flags & IFF_POINTOPOINT) { - if (zserv_privs.change(ZPRIVS_RAISE)) - zlog (NULL, LOG_ERR, "Can't raise privileges"); - ret = AF_IOCTL (af, SIOCGLIFDSTADDR, (caddr_t) & lifreq); - - if (zserv_privs.change(ZPRIVS_LOWER)) - zlog (NULL, LOG_ERR, "Can't lower privileges"); if (ret < 0) { -- cgit v1.2.3