From cf528e4f26a9a43c39f6569509b6753c07fd5fa3 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 18 Apr 2017 09:01:00 -0400 Subject: [PATCH] pimd: When loosing *,G igmp report notify S,G too When we have a S,G that was created due to the *,G IGMP report going away, safely remove the S,G as well. Ticket: CM-15838 Signed-off-by: Donald Sharp Reviewed-by: Anuradha Karuppiah --- pimd/pim_ifchannel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index fc84a5c2fe..b19118f3ac 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -1054,9 +1054,9 @@ void pim_ifchannel_local_membership_del(struct interface *ifp, { struct pim_upstream *up = pim_upstream_find (sg); struct pim_upstream *child; - struct listnode *up_node; + struct listnode *up_node, *up_nnode; - for (ALL_LIST_ELEMENTS_RO (up->sources, up_node, child)) + for (ALL_LIST_ELEMENTS (up->sources, up_node, up_nnode, child)) { struct channel_oil *c_oil = child->channel_oil; struct pim_ifchannel *chchannel = pim_ifchannel_find (ifp, &child->sg); @@ -1077,6 +1077,9 @@ void pim_ifchannel_local_membership_del(struct interface *ifp, */ if (!chchannel && c_oil && c_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index]) pim_channel_del_oif (c_oil, ifp, PIM_OIF_FLAG_PROTO_STAR); + + if (c_oil->oil_size == 0) + pim_upstream_del (child, __PRETTY_FUNCTION__); } } delete_on_noinfo(ch); -- 2.39.5