summaryrefslogtreecommitdiff
path: root/ripngd
diff options
context:
space:
mode:
authorajs <ajs>2005-01-30 18:08:12 +0000
committerajs <ajs>2005-01-30 18:08:12 +0000
commit656b4eeec1fb30402ad2001976c05c6f44fafb34 (patch)
tree6455936be51648bd711d9caf25af49acdc35e604 /ripngd
parent798534576c2525476141628ac14ecc83fd775a5a (diff)
2005-01-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ripng_interface.c: (ripng_multicast_join) Save errno before calling ripngd_privs.change.
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/ChangeLog5
-rw-r--r--ripngd/ripng_interface.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/ripngd/ChangeLog b/ripngd/ChangeLog
index dcd8dedf..f4b61132 100644
--- a/ripngd/ChangeLog
+++ b/ripngd/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+ * ripng_interface.c: (ripng_multicast_join) Save errno before calling
+ ripngd_privs.change.
+
2005-01-04 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ripngd.c: (ripng_recv_packet) Use ZCMSG_FIRSTHDR instead of
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index fa00aabf..bef7699a 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -62,6 +62,7 @@ ripng_multicast_join (struct interface *ifp)
{
int ret;
struct ipv6_mreq mreq;
+ int save_errno;
if (if_is_up (ifp) && if_is_multicast (ifp)) {
memset (&mreq, 0, sizeof (mreq));
@@ -78,11 +79,12 @@ ripng_multicast_join (struct interface *ifp)
ret = setsockopt (ripng->sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
(char *) &mreq, sizeof (mreq));
+ save_errno = errno;
if (ripngd_privs.change (ZPRIVS_LOWER))
zlog_err ("ripng_multicast_join: could not lower privs");
- if (ret < 0 && errno == EADDRINUSE)
+ if (ret < 0 && save_errno == EADDRINUSE)
{
/*
* Group is already joined. This occurs due to sloppy group
@@ -94,7 +96,8 @@ ripng_multicast_join (struct interface *ifp)
}
if (ret < 0)
- zlog_warn ("can't setsockopt IPV6_JOIN_GROUP: %s", safe_strerror (errno));
+ zlog_warn ("can't setsockopt IPV6_JOIN_GROUP: %s",
+ safe_strerror (save_errno));
if (IS_RIPNG_DEBUG_EVENT)
zlog_debug ("RIPng %s join to all-rip-routers multicast group", ifp->name);