summaryrefslogtreecommitdiff
path: root/zebra/if_ioctl_solaris.c
diff options
context:
space:
mode:
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;
}