From 60b1960ff775af627024e92faae9e0e12f709986 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 11 Jul 2016 15:54:37 -0400 Subject: [PATCH] pimd: IGMPv3 leave not deleting group entry After sending a IGMPv3 exclude report for a multicast address with 0 sources, send an include report for the same group and also 0 sources. This should cause IGMP to GS query and age/delete the entry. This fix addresses this issue. Ticket: CM-11685 Signed-off-by: Donald Sharp --- pimd/pim_igmpv3.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index d198ec92be..0a6b6b3795 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -543,6 +543,7 @@ static void allow(struct igmp_sock *igmp, struct in_addr from, struct in_addr group_addr, int num_sources, struct in_addr *sources) { + struct igmp_source *source; struct igmp_group *group; int i; @@ -554,7 +555,6 @@ static void allow(struct igmp_sock *igmp, struct in_addr from, /* scan received sources */ for (i = 0; i < num_sources; ++i) { - struct igmp_source *source; struct in_addr *src_addr; src_addr = sources + i; @@ -577,6 +577,17 @@ static void allow(struct igmp_sock *igmp, struct in_addr from, igmp_source_reset_gmi(igmp, group, source); } /* scan received sources */ + + if ((num_sources == 0) && + (group->group_filtermode_isexcl) && + (listcount (group->group_source_list) == 1)) + { + struct in_addr star = { .s_addr = INADDR_ANY }; + + source = igmp_find_source_by_addr (group, star); + if (source) + igmp_source_reset_gmi (igmp, group, source); + } } void igmpv3_report_isin(struct igmp_sock *igmp, struct in_addr from, -- 2.39.5