diff options
author | Klement Sekera <ksekera@cisco.com> | 2017-02-14 07:55:57 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-02-17 16:32:51 +0000 |
commit | c48829bb0a29e7b53a5e0b6bcecd13a328b19dcf (patch) | |
tree | 2cc06ad7fad252c654d5167a4011ebe3e5ebb6bc /src | |
parent | cb33dc2d7a566d571c86b950b4aa92dd7ae01c3c (diff) |
BFD: put session admin-up/admin-down
Change-Id: I7d8889dce8495607106593ad83320c9af0f2fa07
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/bfd/bfd_main.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/vnet/bfd/bfd_main.c b/src/vnet/bfd/bfd_main.c index 0959d0e076b..c0fd18dfe57 100644 --- a/src/vnet/bfd/bfd_main.c +++ b/src/vnet/bfd/bfd_main.c @@ -335,11 +335,14 @@ bfd_session_set_flags (bfd_session_t * bs, u8 admin_up_down) bfd_main_t *bm = &bfd_main; if (admin_up_down) { + BFD_DBG ("Session set admin-up, bs-idx=%u", bs->bs_idx); bfd_set_state (bm, bs, BFD_STATE_down, 0); + bfd_set_diag (bs, BFD_DIAG_CODE_no_diag); } else { - bfd_set_diag (bs, BFD_DIAG_CODE_neighbor_sig_down); + BFD_DBG ("Session set admin-down, bs-idx=%u", bs->bs_idx); + bfd_set_diag (bs, BFD_DIAG_CODE_admin_down); bfd_set_state (bm, bs, BFD_STATE_admin_down, 0); } } @@ -439,9 +442,7 @@ bfd_on_state_change (bfd_main_t * bm, bfd_session_t * bs, u64 now, break; case BFD_STATE_init: bfd_set_effective_desired_min_tx (bm, bs, now, - clib_max - (bs->config_desired_min_tx_clocks, - bm->default_desired_min_tx_clocks)); + bs->config_desired_min_tx_clocks); bfd_set_timer (bm, bs, now, handling_wakeup); break; case BFD_STATE_up: @@ -714,18 +715,13 @@ bfd_on_timeout (vlib_main_t * vm, vlib_node_runtime_t * rt, bfd_main_t * bm, switch (bs->local_state) { case BFD_STATE_admin_down: - BFD_ERR ("Unexpected timeout when in %s state", - bfd_state_string (bs->local_state)); - abort (); + bfd_send_periodic (vm, rt, bm, bs, now, 1); break; case BFD_STATE_down: bfd_send_periodic (vm, rt, bm, bs, now, 1); break; case BFD_STATE_init: - BFD_ERR ("Unexpected timeout when in %s state", - bfd_state_string (bs->local_state)); - abort (); - break; + /* fallthrough */ case BFD_STATE_up: bfd_check_rx_timeout (bm, bs, now, 1); bfd_send_periodic (vm, rt, bm, bs, now, 1); @@ -1400,7 +1396,11 @@ bfd_consume_pkt (bfd_main_t * bm, const bfd_pkt_t * pkt, u32 bs_idx) } } if (BFD_STATE_admin_down == bs->local_state) - return; + { + BFD_DBG ("Session is admin-down, ignoring packet, bs_idx=%u", + bs->bs_idx); + return; + } if (BFD_STATE_admin_down == bs->remote_state) { bfd_set_diag (bs, BFD_DIAG_CODE_neighbor_sig_down); |