summaryrefslogtreecommitdiffstats
path: root/pimd/pim_igmpv3.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-07-12 17:31:45 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-07-12 17:37:19 +0200
commit5b1207f72c67b65a60959945bb4250409bb8460f (patch)
tree323da596a8f983ec73e1e93931746099c1d88e92 /pimd/pim_igmpv3.c
parentpimd: Start naive implementation of anysource_forward_stop (diff)
downloadfrr-5b1207f72c67b65a60959945bb4250409bb8460f.tar.xz
frr-5b1207f72c67b65a60959945bb4250409bb8460f.zip
pimd: Stale IGMP groups left behind
When a toin IGMPv3 join is received, the code was always auto creating the igmp group associated with the received packet. The RFC clearly states though that if a INCLUDE is received for a group with 0 sources and we have received nothing the igmpv3 packet should be ignored. Ticket: CM-11260 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_igmpv3.c')
-rw-r--r--pimd/pim_igmpv3.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c
index 0a6b6b379..7300e6c6b 100644
--- a/pimd/pim_igmpv3.c
+++ b/pimd/pim_igmpv3.c
@@ -834,11 +834,26 @@ void igmpv3_report_toin(struct igmp_sock *igmp, struct in_addr from,
on_trace(__PRETTY_FUNCTION__,
ifp, from, group_addr, num_sources, sources);
- /* non-existant group is created as INCLUDE {empty} */
- group = igmp_add_group_by_addr(igmp, group_addr);
- if (!group) {
- return;
- }
+ /*
+ * If the requested filter mode is INCLUDE *and* the requested source
+ * list is empty, then the entry corresponding to the requested
+ * interface and multicast address is deleted if present. If no such
+ * entry is present, the request is ignored.
+ */
+ if (num_sources)
+ {
+ /* non-existant group is created as INCLUDE {empty} */
+ group = igmp_add_group_by_addr(igmp, group_addr);
+ if (!group) {
+ return;
+ }
+ }
+ else
+ {
+ group = find_group_by_addr (igmp, group_addr);
+ if (!group)
+ return;
+ }
if (group->group_filtermode_isexcl) {
/* EXCLUDE mode */