From 78b0c6bfa704237907444a89abb62dd5d062909b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 15 Nov 2018 19:17:17 -0500 Subject: [PATCH 1/2] pimd: Add some debugs for when local membership fails When we fail to add a local membership add some additional debugs so that we can have a bit more information on when something goes bad. Signed-off-by: Donald Sharp --- pimd/pim_ifchannel.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index 129d569c87..8f6a9ece53 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -1012,10 +1012,21 @@ int pim_ifchannel_local_membership_add(struct interface *ifp, /* PIM enabled on interface? */ pim_ifp = ifp->info; - if (!pim_ifp) + if (!pim_ifp) { + if (PIM_DEBUG_EVENTS) + zlog_debug("%s:%s Expected pim interface setup for %s", + __PRETTY_FUNCTION__, + pim_str_sg_dump(sg), ifp->name); return 0; - if (!PIM_IF_TEST_PIM(pim_ifp->options)) + } + + if (!PIM_IF_TEST_PIM(pim_ifp->options)) { + if (PIM_DEBUG_EVENTS) + zlog_debug("%s:%s PIM is not configured on this interface %s", + __PRETTY_FUNCTION__, + pim_str_sg_dump(sg), ifp->name); return 0; + } pim = pim_ifp->pim; @@ -1033,6 +1044,10 @@ int pim_ifchannel_local_membership_add(struct interface *ifp, ch = pim_ifchannel_add(ifp, sg, 0, PIM_UPSTREAM_FLAG_MASK_SRC_IGMP); if (!ch) { + if (PIM_DEBUG_EVENTS) + zlog_debug("%s:%s Unable to add ifchannel", + __PRETTY_FUNCTION__, + pim_str_sg_dump(sg)); return 0; } From b96892db623b53e0e8d094088b97ee6b901c9d20 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 15 Nov 2018 19:28:43 -0500 Subject: [PATCH 2/2] pimd: When we fail to initiate ifchannel backout work done When we receive a igmp report and attempt to initiate a pim ifchannel for it and that fails to work then let's back out the work done setting stuff up to this point. Signed-off-by: Donald Sharp --- pimd/pim_zebra.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index 3dfc36a0c2..10ea17cf1f 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -1048,6 +1048,10 @@ void igmp_source_forward_start(struct pim_instance *pim, __PRETTY_FUNCTION__, pim_str_sg_dump(&sg), group->group_igmp_sock->interface->name); + + pim_channel_del_oif(source->source_channel_oil, + group->group_igmp_sock->interface, + PIM_OIF_FLAG_PROTO_IGMP); return; } /* @@ -1059,6 +1063,10 @@ void igmp_source_forward_start(struct pim_instance *pim, if (PIM_DEBUG_MROUTE) zlog_warn("%s: Failure to add local membership for %s", __PRETTY_FUNCTION__, pim_str_sg_dump(&sg)); + + pim_channel_del_oif(source->source_channel_oil, + group->group_igmp_sock->interface, + PIM_OIF_FLAG_PROTO_IGMP); return; }