From: Donald Sharp Date: Wed, 3 Aug 2016 15:34:38 +0000 (-0400) Subject: pimd: Fix upstream state machine. X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~319 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=81900c5a083428f81ac5a92d2846790aa6f4da4f;p=matthieu%2Ffrr.git pimd: Fix upstream state machine. 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 --- diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index e71f856aa3..a304f359eb 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -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; }