From: Donald Sharp Date: Sat, 12 Nov 2016 00:13:55 +0000 (-0500) Subject: pimd: Start handling of wrong interface for (*,G) X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~101 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=0490c22d20fb091d8bb1411c3b5df61a4fdd7c2e;p=mirror%2Ffrr.git pimd: Start handling of wrong interface for (*,G) 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 --- diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 57dc5550db..c3f572c716 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -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);