]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Some bug fixes for the register receive code path
authorDonald Sharp <sharpd@cumulusnetwroks.com>
Sat, 23 Jul 2016 16:30:41 +0000 (12:30 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:03 +0000 (20:26 -0500)
When we receive a register receive handle it a bit
better.

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

index 87a8ca935f40b67f33076029aa24435275daff0c..79bfa4afc9dcd137a40c7b842d07efd682e5d584 100644 (file)
@@ -316,6 +316,14 @@ pim_register_recv (struct interface *ifp,
     if (!upstream)
       {
        upstream = pim_upstream_add (&sg, ifp);
+
+       pim_rp_set_upstream_addr (&upstream->upstream_addr, sg.u.sg.src);
+       pim_nexthop_lookup (&upstream->rpf.source_nexthop,
+                           upstream->upstream_addr, NULL);
+       upstream->rpf.source_nexthop.interface = ifp;
+       upstream->sg.u.sg.src = sg.u.sg.src;
+       upstream->rpf.rpf_addr = upstream->rpf.source_nexthop.mrib_nexthop_addr;
+
        pim_upstream_switch (upstream, PIM_UPSTREAM_PRUNE);
 
       }
@@ -323,14 +331,7 @@ pim_register_recv (struct interface *ifp,
     if ((upstream->sptbit == PIM_UPSTREAM_SPTBIT_TRUE) ||
        ((SwitchToSptDesired(&sg)) &&
         pim_upstream_inherited_olist (upstream) == 0)) {
-      pim_rp_set_upstream_addr (&upstream->upstream_addr, sg.u.sg.src);
-      pim_nexthop_lookup (&upstream->rpf.source_nexthop,
-                           upstream->upstream_addr, NULL);
-      upstream->rpf.source_nexthop.interface = ifp;
-      upstream->sg.u.sg.src = sg.u.sg.src;
-      upstream->rpf.rpf_addr = upstream->rpf.source_nexthop.mrib_nexthop_addr;
-      upstream->channel_oil->oil.mfcc_origin = sg.u.sg.src;
-      pim_scan_individual_oil (upstream->channel_oil);
+      //pim_scan_individual_oil (upstream->channel_oil);
       pim_register_stop_send (ifp, &sg, src_addr);
       sentRegisterStop = 1;
     }
index 34e7d9a759aff96557545a8ee61e3b4449b0ffcb..7d20de6bda48ddd456b5a022756548febc7413a3 100644 (file)
@@ -507,7 +507,8 @@ void pim_upstream_update_join_desired(struct pim_upstream *up)
 
   /* switched from false to true */
   if (is_join_desired && !was_join_desired) {
-    zassert(up->join_state == PIM_UPSTREAM_NOTJOINED);
+    zassert(up->join_state == PIM_UPSTREAM_NOTJOINED ||
+           up->join_state == PIM_UPSTREAM_PRUNE);
     pim_upstream_switch(up, PIM_UPSTREAM_JOINED);
     return;
   }
@@ -914,12 +915,16 @@ pim_upstream_inherited_olist (struct pim_upstream *up)
 
          for (ALL_LIST_ELEMENTS (pim_ifp->pim_ifchannel_list, chnode, chnextnode, ch))
            {
+             struct pim_ifchannel *nch;
+
              if (ch->upstream != anysrc_up)
                continue;
 
              if (ch->ifjoin_state == PIM_IFJOIN_JOIN)
                {
-                 pim_ifchannel_add (ifp, &up->sg);
+                 nch = pim_ifchannel_add (ifp, &up->sg);
+                 pim_ifchannel_ifjoin_switch (__PRETTY_FUNCTION__, nch, PIM_IFJOIN_JOIN);
+                 pim_forward_start (ch);
                  output_intf++;
                }
            }
@@ -927,7 +932,8 @@ pim_upstream_inherited_olist (struct pim_upstream *up)
     }
 
   if (output_intf)
-    pim_upstream_send_join (up);
+    if (up->join_state != PIM_UPSTREAM_JOINED)
+      pim_upstream_switch (up, PIM_UPSTREAM_JOINED);
 
   return output_intf;
 }