]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: Fix some null register issues
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 4 Aug 2016 16:58:47 +0000 (12:58 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:05 +0000 (20:26 -0500)
The Null register bit was not properly being set and
the total length was wrong as well.

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

index abab730439f101923d03c717ef93b8931b2960dc..80e77ecb3201143bdba70d5e754bc3632f1363e2 100644 (file)
@@ -166,7 +166,7 @@ static void recv_prune(struct interface *ifp,
 
       sg.src.s_addr = INADDR_ANY;
     }
-  
+
   pim_ifchannel_prune(ifp, upstream, &sg, source_flags, holdtime);
 
   if (sg.src.s_addr == INADDR_ANY)
@@ -179,18 +179,29 @@ static void recv_prune(struct interface *ifp,
         {
           if (child->parent == up)
             {
+             struct channel_oil *c_oil = child->channel_oil;
+             struct pim_ifchannel *ch = pim_ifchannel_find (ifp, &child->sg);
+             struct pim_interface *pim_ifp = ifp->info;
+
              char buff[100];
              strcpy (buff, pim_str_sg_dump (&up->sg));
              zlog_debug("%s %s: Prune(S,G)=%s from %s",
                         __FILE__, __PRETTY_FUNCTION__,
-                        buff, pim_str_sg_dump (&sg));
+                        buff, pim_str_sg_dump (&child->sg));
 
              if (!pim_upstream_evaluate_join_desired (child))
-               pim_channel_del_oif (child->channel_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
+               pim_channel_del_oif (c_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
+
+             /*
+              * If the S,G has no if channel and the c_oil still
+              * has output here then the *,G was supplying the implied
+              * if channel.  So remove it.
+               */
+             if (!ch && c_oil->oil.mfcc_ttls[pim_ifp->mroute_vif_index])
+               pim_channel_del_oif (c_oil, ifp, PIM_OIF_FLAG_PROTO_PIM);
            }
         }
     }
-
 }
 
 int pim_joinprune_recv(struct interface *ifp,
index c43818dfff462d344ffda32b74b4e6be75715870..15a0e65574e5840d0e536759821480f5e35c5b0e 100644 (file)
@@ -188,7 +188,7 @@ pim_register_send (const uint8_t *buf, int buf_size, struct pim_rpf *rpg, int nu
 
   memset(buffer, 0, 3000);
   b1 = buffer + PIM_MSG_HEADER_LEN;
-  *b1 |= null_register << 31;
+  *b1 |= null_register << 6;
   b1 = buffer + PIM_MSG_REGISTER_LEN;
 
   memcpy(b1, (const unsigned char *)buf, buf_size);
index 9889264aa66cf40a5ae87c9e797330fd1e231345..0d77783738913d0ecc955f066c9f17d0b9cfd800 100644 (file)
@@ -939,7 +939,7 @@ pim_upstream_register_stop_timer (struct thread *t)
       ip_hdr.ip_v = 4;
       ip_hdr.ip_src = up->sg.src;
       ip_hdr.ip_dst = up->sg.grp;
-      ip_hdr.ip_len = 20;
+      ip_hdr.ip_len = htons (20);
       // checksum is broken
       pim_register_send ((uint8_t *)&ip_hdr, sizeof (struct ip), rpg, 1);
       pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM);