]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Fix RP shenanigans
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 10 Aug 2016 20:16:22 +0000 (16:16 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:06 +0000 (20:26 -0500)
The RP was not properly handling the series of events:

1) When a WRVIFWHOLE is received if we are the RP,
send a pim register stop to the FHR.

2) When a register was received we were sending
a join (S,G) towards the S, then a immediate prune (S,G)
followed by another join (S,G).  Just send the first join

3) Save whom we received the S,G register from so we
can use it later

4) Allow a join timer to restart itself instead
of causing a crash.

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

index f6808feb49122d899a33ce4e0c54abfc034924fe..9460219f13a5acfaec2c5f601a51dbf358593f39 100644 (file)
@@ -26,6 +26,7 @@
 #include "prefix.h"
 
 #include "pimd.h"
+#include "pim_rpf.h"
 #include "pim_mroute.h"
 #include "pim_oil.h"
 #include "pim_str.h"
@@ -345,6 +346,17 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
   if (PIM_DEBUG_MROUTE)
     zlog_debug ("If channel: %p", ch);
 
+  up = pim_upstream_find (&sg);
+  if (up)
+    {
+      struct pim_nexthop source;
+      //No if channel, but upstream we are at the RP.
+      pim_nexthop_lookup (&source, up->upstream_register, NULL);
+      pim_register_stop_send(source.interface, &sg, up->upstream_register);
+      //Send S bit down the join.
+      return 0;
+    }
+
   up = pim_upstream_add (&sg, ifp);
 
   if (!up)
index d0fe89b01bb9263de32c74ab47f1e6475b6d24b1..79f9283138cdbf7a4eb530f85bfe923a839eaa0c 100644 (file)
@@ -44,7 +44,7 @@
 
 struct thread *send_test_packet_timer = NULL;
 
-static void
+void
 pim_register_stop_send (struct interface *ifp, struct prefix_sg *sg,
                        struct in_addr originator)
 {
@@ -321,6 +321,7 @@ pim_register_recv (struct interface *ifp,
       {
        upstream = pim_upstream_add (&sg, ifp);
 
+        upstream->upstream_register = src_addr;
        pim_rp_set_upstream_addr (&upstream->upstream_addr, sg.src, sg.grp);
        pim_nexthop_lookup (&upstream->rpf.source_nexthop,
                            upstream->upstream_addr, NULL);
@@ -328,7 +329,8 @@ pim_register_recv (struct interface *ifp,
        upstream->sg.src = sg.src;
        upstream->rpf.rpf_addr = upstream->rpf.source_nexthop.mrib_nexthop_addr;
 
-       pim_upstream_switch (upstream, PIM_UPSTREAM_PRUNE);
+       //pim_upstream_switch (upstream, PIM_UPSTREAM_PRUNE);
+       upstream->join_state = PIM_UPSTREAM_PRUNE;
 
       }
 
index 8ab24b71372e8afd6b5d17cc6f29976754c34576..ce2e052104b89f8460f59f9cdd93a9ff6f22cae3 100644 (file)
@@ -43,5 +43,6 @@ int pim_register_recv (struct interface *ifp,
                       uint8_t *tlv_buf, int tlv_buf_size);
 
 void pim_register_send (const uint8_t *buf, int buf_size, struct pim_rpf *rpg, int null_register);
+void pim_register_stop_send (struct interface *ifp, struct prefix_sg *sg, struct in_addr originator);
 
 #endif
index 932e06b76d96fe36355092817dbd05ab27cd994e..9ee0e870045359ee57a9676c8503c46f24277ff6 100644 (file)
@@ -225,8 +225,7 @@ static void join_timer_start(struct pim_upstream *up)
               pim_str_sg_dump (&up->sg));
   }
 
-  zassert(!up->t_join_timer);
-
+  THREAD_OFF (up->t_join_timer);
   THREAD_TIMER_ON(master, up->t_join_timer,
                  on_join_timer,
                  up, qpim_t_periodic);
index eea9456013fd303516f8bd1b80360a0c65e9fc61..fccb1c4186c402526dd9634bd05d616176384b0b 100644 (file)
@@ -90,6 +90,7 @@ struct pim_upstream {
   struct pim_upstream      *parent;
   int                      fhr;
   struct in_addr           upstream_addr;/* Who we are talking to */
+  struct in_addr           upstream_register; /*Who we received a register from*/
   struct prefix_sg         sg;           /* (S,G) group key */
   uint32_t                 flags;
   struct channel_oil      *channel_oil;