]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Stale IGMP groups left behind
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 12 Jul 2016 15:31:45 +0000 (11:31 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 12 Jul 2016 15:37:19 +0000 (11:37 -0400)
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>
pimd/pim_igmp.c
pimd/pim_igmp.h
pimd/pim_igmpv3.c

index 6df835e252c817e3f2471bf78d04fe3788b8ddef..440d6487237f5510f71a5165f0770f78f57474ea 100644 (file)
@@ -46,9 +46,6 @@
 
 static void group_timer_off(struct igmp_group *group);
 
-static struct igmp_group *find_group_by_addr(struct igmp_sock *igmp,
-                                            struct in_addr group_addr);
-
 static int igmp_sock_open(struct in_addr ifaddr, int ifindex, uint32_t pim_options)
 {
   int fd;
@@ -1358,8 +1355,9 @@ void igmp_group_timer_on(struct igmp_group *group,
                       group, interval_msec);
 }
 
-static struct igmp_group *find_group_by_addr(struct igmp_sock *igmp,
-                                            struct in_addr group_addr)
+struct igmp_group *
+find_group_by_addr (struct igmp_sock *igmp,
+                  struct in_addr group_addr)
 {
   struct igmp_group *group;
   struct listnode   *node;
index ab396159e3862290621c4434780b1373b9ce0ecd..c6685c2837ec2afd357dbe58ec9adc42e68ea553 100644 (file)
@@ -162,6 +162,8 @@ struct igmp_group {
   int64_t           last_igmp_v2_report_dsec;
 };
 
+struct igmp_group *find_group_by_addr (struct igmp_sock *igmp,
+                                      struct in_addr group_addr);
 struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,
                                          struct in_addr group_addr);
 
index 0a6b6b37953c66c61cd87c440a7f7f5a261d0614..7300e6c6b4f25a3905513aa55d3569589181d3a9 100644 (file)
@@ -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 */