summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
Diffstat (limited to 'zebra')
-rw-r--r--zebra/ChangeLog7
-rw-r--r--zebra/ioctl.c9
-rw-r--r--zebra/ioctl_solaris.c7
3 files changed, 18 insertions, 5 deletions
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index 0ebe7052..1f97fef9 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+ * ioctl.c: (if_ioctl,if_ioctl_ipv6,if_get_flags) Replace perror with
+ zlog_err.
+ * ioctl_solaris.c: (if_ioctl,if_ioctl_ipv6) Replace perror with
+ zlog_err.
+
2005-01-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* if_ioctl_solaris.c: (interface_list_ioctl) Save errno before calling
diff --git a/zebra/ioctl.c b/zebra/ioctl.c
index e28d359e..56de810c 100644
--- a/zebra/ioctl.c
+++ b/zebra/ioctl.c
@@ -54,9 +54,10 @@ if_ioctl (u_long request, caddr_t buffer)
sock = socket (AF_INET, SOCK_DGRAM, 0);
if (sock < 0)
{
+ int save_errno = errno;
if (zserv_privs.change(ZPRIVS_LOWER))
zlog (NULL, LOG_ERR, "Can't lower privileges");
- perror ("socket");
+ zlog_err("Cannot create UDP socket: %s", safe_strerror(save_errno));
exit (1);
}
if ((ret = ioctl (sock, request, buffer)) < 0)
@@ -86,9 +87,11 @@ if_ioctl_ipv6 (u_long request, caddr_t buffer)
sock = socket (AF_INET6, SOCK_DGRAM, 0);
if (sock < 0)
{
+ int save_errno = errno;
if (zserv_privs.change(ZPRIVS_LOWER))
zlog (NULL, LOG_ERR, "Can't lower privileges");
- perror ("socket");
+ zlog_err("Cannot create IPv6 datagram socket: %s",
+ safe_strerror(save_errno));
exit (1);
}
@@ -343,7 +346,7 @@ if_get_flags (struct interface *ifp)
ret = if_ioctl (SIOCGIFFLAGS, (caddr_t) &ifreq);
if (ret < 0)
{
- perror ("ioctl");
+ zlog_err("if_ioctl(SIOCGIFFLAGS) failed: %s", safe_strerror(errno));
return;
}
diff --git a/zebra/ioctl_solaris.c b/zebra/ioctl_solaris.c
index 5ec327ac..43e1e83f 100644
--- a/zebra/ioctl_solaris.c
+++ b/zebra/ioctl_solaris.c
@@ -55,9 +55,10 @@ if_ioctl (u_long request, caddr_t buffer)
sock = socket (AF_INET, SOCK_DGRAM, 0);
if (sock < 0)
{
+ int save_errno = errno;
if (zserv_privs.change(ZPRIVS_LOWER))
zlog (NULL, LOG_ERR, "Can't lower privileges");
- perror ("socket");
+ zlog_err("Cannot create UDP socket: %s", safe_strerror(save_errno));
exit (1);
}
@@ -92,9 +93,11 @@ if_ioctl_ipv6 (u_long request, caddr_t buffer)
sock = socket (AF_INET6, SOCK_DGRAM, 0);
if (sock < 0)
{
+ int save_errno = errno;
if (zserv_privs.change(ZPRIVS_LOWER))
zlog (NULL, LOG_ERR, "Can't lower privileges");
- perror ("socket");
+ zlog_err("Cannot create IPv6 datagram socket: %s",
+ safe_strerror(save_errno));
exit (1);
}