summaryrefslogtreecommitdiff
path: root/zebra/if_ioctl_solaris.c
diff options
context:
space:
mode:
authorajs <ajs>2005-01-29 17:07:40 +0000
committerajs <ajs>2005-01-29 17:07:40 +0000
commit4460e7a4cf3dadcd9f06e4b519ba7be2cc936c0a (patch)
tree5755c13aeffb151d56a886868e623d186ca9a0a0 /zebra/if_ioctl_solaris.c
parent4be019d5530e21c9e54e41e46a57ab071b9b11ae (diff)
2005-01-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* if_ioctl_solaris.c: (interface_list_ioctl) Save errno before calling zserv_privs.change. * ioctl{,_solaris}.c: (if_ioctl,if_ioctl_ipv6) Save errno before calling zserv_privs.change. * ipforward_solaris.c: (solaris_nd) Save errno before calling zserv_privs.change. * irdp_main.c: (irdp_sock_init) Save errno before calling zserv_privs.change. [backport candidate]
Diffstat (limited to 'zebra/if_ioctl_solaris.c')
-rw-r--r--zebra/if_ioctl_solaris.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/zebra/if_ioctl_solaris.c b/zebra/if_ioctl_solaris.c
index 1cbf555e..38ac5a71 100644
--- a/zebra/if_ioctl_solaris.c
+++ b/zebra/if_ioctl_solaris.c
@@ -50,6 +50,7 @@ interface_list_ioctl (int af)
struct lifconf lifconf;
struct interface *ifp;
int n;
+ int save_errno;
size_t needed, lastneeded = 0;
char *buf = NULL;
@@ -72,6 +73,7 @@ calculate_lifc_len: /* must hold privileges to enter here */
lifn.lifn_family = af;
lifn.lifn_flags = 0;
ret = ioctl (sock, SIOCGLIFNUM, &lifn);
+ save_errno = errno;
if (zserv_privs.change(ZPRIVS_LOWER))
zlog (NULL, LOG_ERR, "Can't lower privileges");
@@ -79,7 +81,7 @@ calculate_lifc_len: /* must hold privileges to enter here */
if (ret < 0)
{
zlog_warn ("interface_list_ioctl: SIOCGLIFNUM failed %s",
- safe_strerror (errno));
+ safe_strerror (save_errno));
close (sock);
return -1;
}