]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Add debug messages as to why a register packet is rejected.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 19 Sep 2016 17:09:38 +0000 (13:09 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:10 +0000 (20:26 -0500)
When we reject a register message from someone, give some reasoning
as to the why of it being rejected to help in debugging the situation.

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

index f8144557c809feb40b2fa90817669b193a49f676..69a3d6167f38d44041a39b9bfdc331fb6c099097 100644 (file)
@@ -252,6 +252,7 @@ pim_register_recv (struct interface *ifp,
   struct ip *ip_hdr;
   struct prefix_sg sg;
   uint32_t *bits;
+  int i_am_rp = 0;
 
 #define PIM_MSG_REGISTER_BIT_RESERVED_LEN 4
   ip_hdr = (struct ip *)(tlv_buf + PIM_MSG_REGISTER_BIT_RESERVED_LEN);
@@ -305,7 +306,8 @@ pim_register_recv (struct interface *ifp,
   sg.src = ip_hdr->ip_src;
   sg.grp = ip_hdr->ip_dst;
 
-  if (I_am_RP (sg.grp) && (dest_addr.s_addr == ((RP (sg.grp))->rpf_addr.u.prefix4.s_addr))) {
+  i_am_rp = I_am_RP (sg.grp);
+  if (i_am_rp && (dest_addr.s_addr == ((RP (sg.grp))->rpf_addr.u.prefix4.s_addr))) {
     sentRegisterStop = 0;
 
     if (*bits & PIM_REGISTER_BORDER_BIT) {
@@ -373,6 +375,15 @@ pim_register_recv (struct interface *ifp,
        // This is taken care of by the kernel for us
       }
   } else {
+    if (PIM_DEBUG_PIM_REG)
+      {
+       if (!i_am_rp)
+         zlog_debug ("Received Register packet for %s, Rejecting packet because I am not the RP configured for group",
+                     pim_str_sg_dump (&sg));
+       else
+         zlog_debug ("Received Register packet for %s, Rejecting packet because the dst ip address is not the actual RP",
+                     pim_str_sg_dump (&sg));
+      }
     pim_register_stop_send (ifp, &sg, dest_addr, src_addr);
   }