]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ripngd: fix drop of multicast membership when the interface is down
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 18 Nov 2016 17:39:25 +0000 (15:39 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 25 Nov 2016 13:46:06 +0000 (11:46 -0200)
When an interface is shut down, ripng_multicast_leave() is called after
ifp->flags is updated in ripng_interface_down(). So we shouldn't check
if the interface is up in order to proceed with the membership drop.

For consistency's sake, don't check for if_is_up() in
ripng_multicast_join() as well. In this case, this function is only
called when the interface is up, so the check was unnecessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ripngd/ripng_interface.c

index c4dec7e7b1ae2da37ee15f5f31539b253415743c..a8742ec9a48924997d48dfd6a33e3b0327d11add 100644 (file)
@@ -65,7 +65,7 @@ ripng_multicast_join (struct interface *ifp)
   struct ipv6_mreq mreq;
   int save_errno;
 
-  if (if_is_up (ifp) && if_is_multicast (ifp)) {
+  if (if_is_multicast (ifp)) {
     memset (&mreq, 0, sizeof (mreq));
     inet_pton(AF_INET6, RIPNG_GROUP, &mreq.ipv6mr_multiaddr);
     mreq.ipv6mr_interface = ifp->ifindex;
@@ -116,7 +116,7 @@ ripng_multicast_leave (struct interface *ifp)
   int ret;
   struct ipv6_mreq mreq;
 
-  if (if_is_up (ifp) && if_is_multicast (ifp)) {
+  if (if_is_multicast (ifp)) {
     memset (&mreq, 0, sizeof (mreq));
     inet_pton(AF_INET6, RIPNG_GROUP, &mreq.ipv6mr_multiaddr);
     mreq.ipv6mr_interface = ifp->ifindex;