From 656b4eeec1fb30402ad2001976c05c6f44fafb34 Mon Sep 17 00:00:00 2001 From: ajs Date: Sun, 30 Jan 2005 18:08:12 +0000 Subject: 2005-01-30 Andrew J. Schorr * ripng_interface.c: (ripng_multicast_join) Save errno before calling ripngd_privs.change. --- ripngd/ChangeLog | 5 +++++ ripngd/ripng_interface.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'ripngd') 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 + + * ripng_interface.c: (ripng_multicast_join) Save errno before calling + ripngd_privs.change. + 2005-01-04 Andrew J. Schorr * 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); -- cgit v1.2.1