]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Notice when we receive a packet type we can't handle yet
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 1 Oct 2015 16:40:52 +0000 (12:40 -0400)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:33 +0000 (20:38 -0400)
There are PIM packet types that have not been implemented yet.
Notice when we get one of those and safely do nothing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_pim.c

index cd8a29031f719b630112b7889a190b7a207595cf..66fc59be58b869129d5234be6084585393fd08f0 100644 (file)
@@ -206,6 +206,20 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)
               pim_version, pim_type, pim_msg_len, checksum);
   }
 
+  if (pim_type == PIM_MSG_TYPE_REGISTER  ||
+      pim_type == PIM_MSG_TYPE_REG_STOP  ||
+      pim_type == PIM_MSG_TYPE_BOOTSTRAP ||
+      pim_type == PIM_MSG_TYPE_GRAFT     ||
+      pim_type == PIM_MSG_TYPE_GRAFT_ACK ||
+      pim_type == PIM_MSG_TYPE_CANDIDATE)
+    {
+      if (PIM_DEBUG_PIM_PACKETS) {
+       zlog_debug("Recv PIM packet type %d which is not currently understood",
+                  pim_type);
+      }
+      return -1;
+    }
+
   if (pim_type == PIM_MSG_TYPE_HELLO) {
     int result = pim_hello_recv(ifp,
                  ip_hdr->ip_src,