diff options
Diffstat (limited to 'src/plugins/lacp/rx_machine.c')
-rw-r--r-- | src/plugins/lacp/rx_machine.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/lacp/rx_machine.c b/src/plugins/lacp/rx_machine.c index fd65aa3ae8e..070b9089cd2 100644 --- a/src/plugins/lacp/rx_machine.c +++ b/src/plugins/lacp/rx_machine.c @@ -206,11 +206,15 @@ lacp_compare_partner (slave_if_t * sif) } static void -lacp_record_pdu (slave_if_t * sif) +lacp_record_pdu (vlib_main_t * vm, slave_if_t * sif) { lacp_pdu_t *lacpdu = (lacp_pdu_t *) sif->last_rx_pkt; u8 match; + /* Transition PTX out of NO_PERIODIC if needed */ + if (!(sif->partner.state & LACP_STATE_LACP_ACTIVITY) && + (lacpdu->actor.port_info.state & LACP_STATE_LACP_ACTIVITY)) + lacp_ptx_post_short_timeout_event (vm, sif); match = lacp_compare_partner (sif); sif->partner = lacpdu->actor.port_info; sif->actor.state &= ~LACP_STATE_DEFAULTED; @@ -285,8 +289,7 @@ lacp_rx_action_expired (void *p1, void *p2) sif->partner.state &= ~LACP_STATE_SYNCHRONIZATION; sif->partner.state |= LACP_STATE_LACP_TIMEOUT; - lacp_machine_dispatch (&lacp_ptx_machine, vm, sif, - LACP_PTX_EVENT_SHORT_TIMEOUT, &sif->ptx_state); + lacp_ptx_post_short_timeout_event (vm, sif); if (lacp_timer_is_running (sif->current_while_timer) && lacp_timer_is_expired (lm->vlib_main, sif->current_while_timer)) timer_expired = 1; @@ -324,6 +327,7 @@ lacp_rx_action_defaulted (void *p1, void *p2) vlib_main_t *vm = (vlib_main_t *) p1; slave_if_t *sif = (slave_if_t *) p2; + lacp_stop_timer (&sif->current_while_timer); lacp_update_default_selected (vm, sif); lacp_record_default (sif); sif->actor.state &= ~LACP_STATE_EXPIRED; @@ -365,7 +369,7 @@ lacp_rx_action_current (void *p1, void *p2) lacp_update_selected (vm, sif); lacp_update_ntt (vm, sif); - lacp_record_pdu (sif); + lacp_record_pdu (vm, sif); lacp_start_current_while_timer (lm->vlib_main, sif, sif->ttl_in_seconds); sif->actor.state &= ~LACP_STATE_EXPIRED; if (lacp_port_is_moved (vm, sif)) |