]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Start handling of wrong interface for (*,G)
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 12 Nov 2016 00:13:55 +0000 (19:13 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:15 +0000 (20:26 -0500)
When we get a callback for a specific (S,G) and
we have no ifchannel for it, see if we have a
(*,G) channel and handle it appropriately.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_mroute.c

index 57dc5550db054d10530240da858838d618de3745..c3f572c716c9c0ca2d3117db9b94d507c2771835 100644 (file)
@@ -235,32 +235,39 @@ pim_mroute_msg_wrongvif (int fd, struct interface *ifp, const struct igmpmsg *ms
   */
 
   if (!ifp) {
-    if (PIM_DEBUG_MROUTE) {
+    if (PIM_DEBUG_MROUTE)
       zlog_debug("%s: WRONGVIF (S,G)=%s could not find input interface for input_vif_index=%d",
                 __PRETTY_FUNCTION__,
                 pim_str_sg_dump (&sg), msg->im_vif);
-    }
     return -1;
   }
 
   pim_ifp = ifp->info;
   if (!pim_ifp) {
-    if (PIM_DEBUG_MROUTE) {
+    if (PIM_DEBUG_MROUTE)
       zlog_debug("%s: WRONGVIF (S,G)=%s multicast not enabled on interface %s",
                 __PRETTY_FUNCTION__,
                 pim_str_sg_dump (&sg), ifp->name);
-    }
     return -2;
   }
 
   ch = pim_ifchannel_find(ifp, &sg);
   if (!ch) {
-    if (PIM_DEBUG_MROUTE) {
+    struct prefix_sg star_g = sg;
+    if (PIM_DEBUG_MROUTE)
       zlog_debug("%s: WRONGVIF (S,G)=%s could not find channel on interface %s",
                 __PRETTY_FUNCTION__,
-                pim_str_sg_dump (&sg), ifp->name);
+                pim_str_sg_dump(&sg), ifp->name);
+
+    star_g.src.s_addr = INADDR_ANY;
+    ch = pim_ifchannel_find(ifp, &star_g);
+    if (!ch) {
+      if (PIM_DEBUG_MROUTE)
+       zlog_debug("%s: WRONGVIF (*,G)=%s could not find channel on interface %s",
+                  __PRETTY_FUNCTION__,
+                  pim_str_sg_dump(&star_g), ifp->name);
+      return -3;
     }
-    return -3;
   }
 
   /*
@@ -281,7 +288,7 @@ pim_mroute_msg_wrongvif (int fd, struct interface *ifp, const struct igmpmsg *ms
     if (PIM_DEBUG_MROUTE) {
       zlog_debug("%s: WRONGVIF (S,G)=%s channel is not on Assert NoInfo state for interface %s",
                 __PRETTY_FUNCTION__,
-                pim_str_sg_dump (&sg), ifp->name);
+                pim_str_sg_dump (&ch->sg), ifp->name);
     }
     return -4;
   }
@@ -290,7 +297,7 @@ pim_mroute_msg_wrongvif (int fd, struct interface *ifp, const struct igmpmsg *ms
     if (PIM_DEBUG_MROUTE) {
       zlog_debug("%s: WRONGVIF (S,G)=%s interface %s is not downstream for channel",
                 __PRETTY_FUNCTION__,
-                pim_str_sg_dump (&sg), ifp->name);
+                pim_str_sg_dump (&ch->sg), ifp->name);
     }
     return -5;
   }
@@ -299,7 +306,7 @@ pim_mroute_msg_wrongvif (int fd, struct interface *ifp, const struct igmpmsg *ms
     if (PIM_DEBUG_MROUTE) {
       zlog_debug("%s: WRONGVIF (S,G)=%s assert_action_a1 failure on interface %s",
                 __PRETTY_FUNCTION__,
-                pim_str_sg_dump (&sg), ifp->name);
+                pim_str_sg_dump (&ch->sg), ifp->name);
     }
     return -6;
   }
@@ -314,6 +321,7 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
   struct pim_interface *pim_ifp;
   struct pim_ifchannel *ch;
   struct pim_upstream *up;
+  struct prefix_sg star_g;
   struct prefix_sg sg;
   struct channel_oil *oil;
 
@@ -333,6 +341,16 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
                    pim_str_sg_dump (&sg), ifp->name);
       return -1;
     }
+  star_g = sg;
+  star_g.src.s_addr = INADDR_ANY;
+  ch = pim_ifchannel_find(ifp, &star_g);
+  if (ch)
+    {
+      if (PIM_DEBUG_MROUTE)
+       zlog_debug ("WRVIFWHOLE (*,G)=%s found ifchannel on interface %s",
+                   pim_str_sg_dump (&star_g), ifp->name);
+      return -1;
+    }
 
   if (PIM_DEBUG_MROUTE)
     zlog_debug ("If channel: %p", ch);