]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Fix upstream state machine.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 3 Aug 2016 15:34:38 +0000 (11:34 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:05 +0000 (20:26 -0500)
RFC 4601 4.5.7:
Joined
      The downstream state machines and local membership information
      indicate that the router should join the shortest-path tree for
      this (S,G).

The code has a upstream state that is in 'J' state already
due to a S,G multicast packet received on an incoming
interface.  This packet has been forwarded to the RP.
The RP sees this and immediately sends a join towards
the S,G.

The code as originally written assumed that you could
not transition from a J state to a J state.  This is not
true.

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

index e71f856aa3d4e88c04b3b185f02e8eb2e6054d4c..a304f359ebfe5a2088c5ef74e7b5463cb6bb6083 100644 (file)
@@ -381,8 +381,6 @@ pim_upstream_switch(struct pim_upstream *up,
 {
   enum pim_upstream_state old_state = up->join_state;
 
-  zassert(old_state != new_state);
-  
   up->join_state       = new_state;
   up->state_transition = pim_time_monotonic_sec();
 
@@ -396,9 +394,16 @@ pim_upstream_switch(struct pim_upstream *up,
   pim_upstream_update_assert_tracking_desired(up);
 
   if (new_state == PIM_UPSTREAM_JOINED) {
-    forward_on(up);
-    pim_upstream_send_join (up);
-    join_timer_start(up);
+    if (old_state != PIM_UPSTREAM_JOINED)
+      {
+        forward_on(up);
+        pim_upstream_send_join (up);
+        join_timer_start(up);
+      }
+    else
+      {
+        forward_on (up);
+      }
   }
   else {
     forward_off(up);
@@ -596,8 +601,6 @@ 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 ||
-           up->join_state == PIM_UPSTREAM_PRUNE);
     pim_upstream_switch(up, PIM_UPSTREAM_JOINED);
     return;
   }