diff options
author | Klement Sekera <ksekera@cisco.com> | 2020-02-10 11:49:52 +0000 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-02-17 12:49:46 +0000 |
commit | a316744bc5e003d0fa4c8aff82c619b300115f02 (patch) | |
tree | 49ef9c1b79483ac55db1e08c6be100c5ce343fee /src/vnet/bfd/bfd_udp.c | |
parent | 00fdf53c7076d1bd0045439e73f0144d613eb09c (diff) |
bfd: use tw_timer_template instead of legacy wheel
Type: refactor
Change-Id: I04e71a64e676910dc4c6cbc1ab54ffb0c29aa5b9
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet/bfd/bfd_udp.c')
-rw-r--r-- | src/vnet/bfd/bfd_udp.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/vnet/bfd/bfd_udp.c b/src/vnet/bfd/bfd_udp.c index 0a9106e78e5..0edf8a8d463 100644 --- a/src/vnet/bfd/bfd_udp.c +++ b/src/vnet/bfd/bfd_udp.c @@ -834,7 +834,7 @@ bfd_udp_del_session (u32 sw_if_index, } vnet_api_error_t -bfd_udp_session_set_flags (u32 sw_if_index, +bfd_udp_session_set_flags (vlib_main_t * vm, u32 sw_if_index, const ip46_address_t * local_addr, const ip46_address_t * peer_addr, u8 admin_up_down) { @@ -849,7 +849,7 @@ bfd_udp_session_set_flags (u32 sw_if_index, bfd_unlock (bm); return rv; } - bfd_session_set_flags (bs, admin_up_down); + bfd_session_set_flags (vm, bs, admin_up_down); bfd_unlock (bm); return 0; } @@ -1036,11 +1036,11 @@ typedef struct } bfd_rpc_update_t; static void -bfd_rpc_update_session (u32 bs_idx, const bfd_pkt_t * pkt) +bfd_rpc_update_session (vlib_main_t * vm, u32 bs_idx, const bfd_pkt_t * pkt) { bfd_main_t *bm = &bfd_main; bfd_lock (bm); - bfd_consume_pkt (bm, pkt, bs_idx); + bfd_consume_pkt (vm, bm, pkt, bs_idx); bfd_unlock (bm); } @@ -1102,7 +1102,7 @@ bfd_udp4_scan (vlib_main_t * vm, vlib_node_runtime_t * rt, return BFD_UDP_ERROR_BAD; } BFD_DBG ("BFD session found, bs_idx=%u", bs->bs_idx); - if (!bfd_verify_pkt_auth (pkt, b->current_length, bs)) + if (!bfd_verify_pkt_auth (vm, pkt, b->current_length, bs)) { BFD_ERR ("Packet verification failed, dropping packet"); return BFD_UDP_ERROR_BAD; @@ -1112,7 +1112,7 @@ bfd_udp4_scan (vlib_main_t * vm, vlib_node_runtime_t * rt, { return err; } - bfd_rpc_update_session (bs->bs_idx, pkt); + bfd_rpc_update_session (vm, bs->bs_idx, pkt); *bs_out = bs; return BFD_UDP_ERROR_NONE; } @@ -1246,7 +1246,7 @@ bfd_udp6_scan (vlib_main_t * vm, vlib_node_runtime_t * rt, return BFD_UDP_ERROR_BAD; } BFD_DBG ("BFD session found, bs_idx=%u", bs->bs_idx); - if (!bfd_verify_pkt_auth (pkt, b->current_length, bs)) + if (!bfd_verify_pkt_auth (vm, pkt, b->current_length, bs)) { BFD_ERR ("Packet verification failed, dropping packet"); return BFD_UDP_ERROR_BAD; @@ -1256,7 +1256,7 @@ bfd_udp6_scan (vlib_main_t * vm, vlib_node_runtime_t * rt, { return err; } - bfd_rpc_update_session (bs->bs_idx, pkt); + bfd_rpc_update_session (vm, bs->bs_idx, pkt); *bs_out = bs; return BFD_UDP_ERROR_NONE; } @@ -1461,7 +1461,7 @@ bfd_udp_echo_input (vlib_main_t * vm, vlib_node_runtime_t * rt, } bfd_lock (bm); - if (bfd_consume_echo_pkt (bfd_udp_main.bfd_main, b0)) + if (bfd_consume_echo_pkt (vm, bfd_udp_main.bfd_main, b0)) { b0->error = rt->errors[BFD_UDP_ERROR_NONE]; next0 = BFD_UDP_ECHO_INPUT_NEXT_NORMAL; @@ -1599,7 +1599,7 @@ bfd_udp_sw_if_add_del (vnet_main_t * vnm, u32 sw_if_index, u32 is_create) vlib_log_notice (bum->log_class, "removal of sw_if_index=%u forces removal of bfd session " "with bs_idx=%u", sw_if_index, (*bs)->bs_idx); - bfd_session_set_flags (*bs, 0); + bfd_session_set_flags (vlib_get_main (), *bs, 0); bfd_udp_del_session_internal (vlib_get_main (), *bs); } return 0; |