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 <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-08-03 11:34:38 -04:00
parent d41b415c8b
commit 81900c5a08

View 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;
}