]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Allow FHR/RP/LHR to be one and the same
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 1 Nov 2016 00:49:18 +0000 (20:49 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:13 +0000 (20:26 -0500)
When we have a FHR/RP/LHR all on the same box, we were
experiencing a situation where we were not sending
a register stop nor where we setting the sptbit.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
fd

pimd/pim_mroute.c

index a4ce4a5f33e4d157284fe525b3ef50ab4bc3b5f6..d0afb124a3410d6fc7ae26cef4b01564a4f64a60 100644 (file)
@@ -335,17 +335,20 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
   up = pim_upstream_find (&sg);
   if (up)
     {
+      struct pim_nexthop source;
+      struct pim_rpf *rpf = RP (sg.grp);
+      if (!rpf || !rpf->source_nexthop.interface)
+        return 0;
+
+      pim_ifp = rpf->source_nexthop.interface->info;
+
+      memset (&source, 0, sizeof (source));
       /*
        * If we are the fhr that means we are getting a callback during
        * the pimreg period, so I believe we can ignore this packet
        */
       if (!PIM_UPSTREAM_FLAG_TEST_FHR(up->flags))
        {
-         struct pim_nexthop source;
-         struct pim_rpf *rpf = RP (sg.grp);
-         pim_ifp = rpf->source_nexthop.interface->info;
-
-         memset (&source, 0, sizeof (source));
          //No if channel, but upstream we are at the RP.
          if (pim_nexthop_lookup (&source, up->upstream_register, 0) == 0)
            pim_register_stop_send(source.interface, &sg, pim_ifp->primary_address, up->upstream_register);
@@ -359,6 +362,12 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
        }
       else
        {
+         if (I_am_RP (up->sg.grp))
+           {
+             if (pim_nexthop_lookup (&source, up->upstream_register, 0) == 0)
+               pim_register_stop_send(source.interface, &sg, pim_ifp->primary_address, up->upstream_register);
+             up->sptbit = PIM_UPSTREAM_SPTBIT_TRUE;
+           }
          pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time);
          pim_upstream_inherited_olist (up);
          pim_mroute_msg_wholepkt (fd, ifp, buf);