]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: With igmpv2 turned on don't accept 224.0.0.0/24 groups
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 2 Dec 2016 17:48:06 +0000 (12:48 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:18 +0000 (20:26 -0500)
When a group is in the 224.0.0.0/24 range and we
have igmp v2 turned on do not allow it to be
considered for inclusion as a mroute.

Ticket: CM-13855
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:

pimd/pim_igmp.c
pimd/pim_util.c
pimd/pim_util.h

index 1ca79a5a546adc0c34e9800e649acd1738f1f35e..456b9ad742b1952079c695222a5b212f0467aaef 100644 (file)
@@ -1057,6 +1057,12 @@ struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp,
       return NULL;
     }
 
+  if (pim_is_group_224_0_0_0_24 (group_addr))
+    {
+      zlog_warn("%s: Group specified is part of 224.0.0.0/24",
+               __PRETTY_FUNCTION__);
+      return NULL;
+    }
   /*
     Non-existant group is created as INCLUDE {empty}:
 
index 087101e1a291b166e76dd01927ab6a26af1ecf8b..1b1b5ef8f34f95fcc4e81463ee408e294234389e 100644 (file)
@@ -106,6 +106,26 @@ void pim_pkt_dump(const char *label, const uint8_t *buf, int size)
   zlog_hexdump(buf, size);
 }
 
+int
+pim_is_group_224_0_0_0_24 (struct in_addr group_addr)
+{
+  static int first = 1;
+  static struct prefix group_224;
+  struct prefix group;
+
+  if (first)
+    {
+      str2prefix ("224.0.0.0/24", &group_224);
+      first = 0;
+    }
+
+  group.family = AF_INET;
+  group.u.prefix4 = group_addr;
+  group.prefixlen = 32;
+
+  return prefix_match (&group_224, &group);
+}
+
 int
 pim_is_group_224_4 (struct in_addr group_addr)
 {
index a948f81ce865a2f8de7c37867ec6c4838df4c6c8..3a7844b4025b9d77c0ebdfd2a80064bc6690fd1f 100644 (file)
@@ -33,5 +33,6 @@ uint16_t igmp_msg_decode8to16(uint8_t code);
 
 void pim_pkt_dump(const char *label, const uint8_t *buf, int size);
 
+int pim_is_group_224_0_0_0_24 (struct in_addr group_addr);
 int pim_is_group_224_4 (struct in_addr group_addr);
 #endif /* PIM_UTIL_H */