From e9a756ffe13f0b008603168a1c891305b3c5488b Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Tue, 29 Apr 2025 14:31:07 -0400 Subject: [PATCH] bgpd,zebra: remove use of the EVENT_OFF macro Replace use of deprecated macro with direct api call. Signed-off-by: Mark Stapp --- bgpd/bgp_bmp.c | 28 +++---- bgpd/bgp_conditional_adv.c | 2 +- bgpd/bgp_damp.c | 4 +- bgpd/bgp_dump.c | 2 +- bgpd/bgp_evpn_mh.c | 2 +- bgpd/bgp_fsm.c | 160 ++++++++++++++++++------------------ bgpd/bgp_io.c | 4 +- bgpd/bgp_main.c | 2 +- bgpd/bgp_network.c | 10 +-- bgpd/bgp_packet.c | 4 +- bgpd/bgp_route.c | 6 +- bgpd/bgp_routemap.c | 2 +- bgpd/bgp_rpki.c | 2 +- bgpd/bgp_updgrp.c | 6 +- bgpd/bgp_updgrp_adv.c | 2 +- bgpd/bgp_vty.c | 10 +-- bgpd/bgpd.c | 48 +++++------ bgpd/rfapi/rfapi_import.c | 14 ++-- bgpd/rfapi/rfapi_monitor.c | 12 +-- bgpd/rfapi/rfapi_rib.c | 14 ++-- bgpd/rfapi/vnc_export_bgp.c | 6 +- zebra/dplane_fpm_nl.c | 26 +++--- zebra/interface.c | 2 +- zebra/irdp_main.c | 4 +- zebra/kernel_netlink.c | 2 +- zebra/rtadv.c | 6 +- zebra/zebra_dplane.c | 4 +- zebra/zebra_evpn_mac.c | 6 +- zebra/zebra_evpn_mh.c | 4 +- zebra/zebra_evpn_neigh.c | 6 +- zebra/zebra_evpn_neigh.h | 2 +- zebra/zebra_fpm.c | 12 +-- zebra/zebra_gr.c | 6 +- zebra/zebra_netns_notify.c | 2 +- zebra/zebra_nhg.c | 8 +- zebra/zebra_ptm.c | 8 +- zebra/zebra_pw.c | 4 +- zebra/zebra_rib.c | 4 +- zebra/zebra_routemap.c | 6 +- zebra/zebra_router.c | 2 +- zebra/zebra_vxlan.c | 6 +- zebra/zserv.c | 8 +- 42 files changed, 234 insertions(+), 234 deletions(-) diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index e09e7b4941..446d9d68ea 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -2136,7 +2136,7 @@ static void bmp_close(struct bmp *bmp) struct bmp_queue_entry *bqe; struct bmp_mirrorq *bmq; - EVENT_OFF(bmp->t_read); + event_cancel(&bmp->t_read); if (bmp->active) bmp_active_disconnected(bmp->active); @@ -2151,7 +2151,7 @@ static void bmp_close(struct bmp *bmp) if (!bqe->refcount) XFREE(MTYPE_BMP_QUEUE, bqe); - EVENT_OFF(bmp->t_read); + event_cancel(&bmp->t_read); pullwr_del(bmp->pullwr); close(bmp->socket); } @@ -2371,7 +2371,7 @@ static void bmp_targets_put(struct bmp_targets *bt) struct bmp_active *ba; struct bmp_imported_bgp *bib; - EVENT_OFF(bt->t_stats); + event_cancel(&bt->t_stats); frr_each_safe (bmp_actives, &bt->actives, ba) bmp_active_put(ba); @@ -2527,7 +2527,7 @@ out_sock: static void bmp_listener_stop(struct bmp_listener *bl) { - EVENT_OFF(bl->t_accept); + event_cancel(&bl->t_accept); if (bl->sock != -1) close(bl->sock); @@ -2566,9 +2566,9 @@ static struct bmp_active *bmp_active_get(struct bmp_targets *bt, static void bmp_active_put(struct bmp_active *ba) { - EVENT_OFF(ba->t_timer); - EVENT_OFF(ba->t_read); - EVENT_OFF(ba->t_write); + event_cancel(&ba->t_timer); + event_cancel(&ba->t_read); + event_cancel(&ba->t_write); bmp_actives_del(&ba->targets->actives, ba); @@ -2709,9 +2709,9 @@ static void bmp_active_thread(struct event *t) /* all 3 end up here, though only timer or read+write are active * at a time */ - EVENT_OFF(ba->t_timer); - EVENT_OFF(ba->t_read); - EVENT_OFF(ba->t_write); + event_cancel(&ba->t_timer); + event_cancel(&ba->t_read); + event_cancel(&ba->t_write); ba->last_err = NULL; @@ -2765,9 +2765,9 @@ static void bmp_active_disconnected(struct bmp_active *ba) static void bmp_active_setup(struct bmp_active *ba) { - EVENT_OFF(ba->t_timer); - EVENT_OFF(ba->t_read); - EVENT_OFF(ba->t_write); + event_cancel(&ba->t_timer); + event_cancel(&ba->t_read); + event_cancel(&ba->t_write); if (ba->bmp) return; @@ -3048,7 +3048,7 @@ DEFPY(bmp_stats_cfg, { VTY_DECLVAR_CONTEXT_SUB(bmp_targets, bt); - EVENT_OFF(bt->t_stats); + event_cancel(&bt->t_stats); if (no) bt->stat_msec = 0; else if (interval_str) diff --git a/bgpd/bgp_conditional_adv.c b/bgpd/bgp_conditional_adv.c index a99d0201e7..38ec603a96 100644 --- a/bgpd/bgp_conditional_adv.c +++ b/bgpd/bgp_conditional_adv.c @@ -354,7 +354,7 @@ void bgp_conditional_adv_disable(struct peer *peer, afi_t afi, safi_t safi) } /* Last filter removed. So cancel conditional routes polling thread. */ - EVENT_OFF(bgp->t_condition_check); + event_cancel(&bgp->t_condition_check); } static void peer_advertise_map_filter_update(struct peer *peer, afi_t afi, diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index 93f5a19902..d41e0c66a3 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -519,7 +519,7 @@ void bgp_damp_info_clean(struct bgp *bgp, struct bgp_damp_config *bdc, XFREE(MTYPE_BGP_DAMP_ARRAY, bdc->reuse_list); bdc->reuse_list_size = 0; - EVENT_OFF(bdc->t_reuse); + event_cancel(&bdc->t_reuse); } /* Disable route flap dampening for a bgp instance. @@ -540,7 +540,7 @@ int bgp_damp_disable(struct bgp *bgp, afi_t afi, safi_t safi) return 0; /* Cancel reuse event. */ - EVENT_OFF(bdc->t_reuse); + event_cancel(&bdc->t_reuse); /* Clean BGP dampening information. */ bgp_damp_info_clean(bgp, bdc, afi, safi); diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index e71835d1cf..da660de97a 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -698,7 +698,7 @@ static int bgp_dump_unset(struct bgp_dump *bgp_dump) } /* Removing interval event. */ - EVENT_OFF(bgp_dump->t_interval); + event_cancel(&bgp_dump->t_interval); bgp_dump->interval = 0; diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index 70040f83b9..929784123d 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -5014,7 +5014,7 @@ void bgp_evpn_mh_finish(void) bgp_evpn_es_local_info_clear(es, true); } if (bgp_mh_info->t_cons_check) - EVENT_OFF(bgp_mh_info->t_cons_check); + event_cancel(&bgp_mh_info->t_cons_check); list_delete(&bgp_mh_info->local_es_list); list_delete(&bgp_mh_info->pend_es_list); list_delete(&bgp_mh_info->ead_es_export_rtl); diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index f5d62828a1..befe58063e 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -171,17 +171,17 @@ static struct peer *peer_xfer_conn(struct peer *from_peer) */ bgp_keepalives_off(keeper); - EVENT_OFF(going_away->t_routeadv); - EVENT_OFF(going_away->t_connect); - EVENT_OFF(going_away->t_delayopen); - EVENT_OFF(going_away->t_connect_check_r); - EVENT_OFF(going_away->t_connect_check_w); - EVENT_OFF(going_away->t_stop_with_notify); - EVENT_OFF(keeper->t_routeadv); - EVENT_OFF(keeper->t_connect); - EVENT_OFF(keeper->t_delayopen); - EVENT_OFF(keeper->t_connect_check_r); - EVENT_OFF(keeper->t_connect_check_w); + event_cancel(&going_away->t_routeadv); + event_cancel(&going_away->t_connect); + event_cancel(&going_away->t_delayopen); + event_cancel(&going_away->t_connect_check_r); + event_cancel(&going_away->t_connect_check_w); + event_cancel(&going_away->t_stop_with_notify); + event_cancel(&keeper->t_routeadv); + event_cancel(&keeper->t_connect); + event_cancel(&keeper->t_delayopen); + event_cancel(&keeper->t_connect_check_r); + event_cancel(&keeper->t_connect_check_w); frr_with_mutex (&bm->peer_connection_mtx) { if (peer_connection_fifo_member(&bm->connection_fifo, keeper)) @@ -334,23 +334,23 @@ void bgp_timer_set(struct peer_connection *connection) inactive. All other timer must be turned off */ if (BGP_PEER_START_SUPPRESSED(peer) || peer_active(connection) != BGP_PEER_ACTIVE || peer->bgp->vrf_id == VRF_UNKNOWN) { - EVENT_OFF(connection->t_start); + event_cancel(&connection->t_start); } else { BGP_TIMER_ON(connection->t_start, bgp_start_timer, peer->v_start); } - EVENT_OFF(connection->t_connect); - EVENT_OFF(connection->t_holdtime); + event_cancel(&connection->t_connect); + event_cancel(&connection->t_holdtime); bgp_keepalives_off(connection); - EVENT_OFF(connection->t_routeadv); - EVENT_OFF(connection->t_delayopen); + event_cancel(&connection->t_routeadv); + event_cancel(&connection->t_delayopen); break; case Connect: /* After start timer is expired, the peer moves to Connect status. Make sure start timer is off and connect timer is on. */ - EVENT_OFF(connection->t_start); + event_cancel(&connection->t_start); if (CHECK_FLAG(peer->flags, PEER_FLAG_TIMER_DELAYOPEN)) BGP_TIMER_ON(connection->t_connect, bgp_connect_timer, (peer->v_delayopen + peer->v_connect)); @@ -358,19 +358,19 @@ void bgp_timer_set(struct peer_connection *connection) BGP_TIMER_ON(connection->t_connect, bgp_connect_timer, peer->v_connect); - EVENT_OFF(connection->t_holdtime); + event_cancel(&connection->t_holdtime); bgp_keepalives_off(connection); - EVENT_OFF(connection->t_routeadv); + event_cancel(&connection->t_routeadv); break; case Active: /* Active is waiting connection from remote peer. And if connect timer is expired, change status to Connect. */ - EVENT_OFF(connection->t_start); + event_cancel(&connection->t_start); /* If peer is passive mode, do not set connect timer. */ if (CHECK_FLAG(peer->flags, PEER_FLAG_PASSIVE) || CHECK_FLAG(peer->sflags, PEER_STATUS_NSF_WAIT)) { - EVENT_OFF(connection->t_connect); + event_cancel(&connection->t_connect); } else { if (CHECK_FLAG(peer->flags, PEER_FLAG_TIMER_DELAYOPEN)) BGP_TIMER_ON(connection->t_connect, @@ -381,30 +381,30 @@ void bgp_timer_set(struct peer_connection *connection) BGP_TIMER_ON(connection->t_connect, bgp_connect_timer, peer->v_connect); } - EVENT_OFF(connection->t_holdtime); + event_cancel(&connection->t_holdtime); bgp_keepalives_off(connection); - EVENT_OFF(connection->t_routeadv); + event_cancel(&connection->t_routeadv); break; case OpenSent: /* OpenSent status. */ - EVENT_OFF(connection->t_start); - EVENT_OFF(connection->t_connect); + event_cancel(&connection->t_start); + event_cancel(&connection->t_connect); if (peer->v_holdtime != 0) { BGP_TIMER_ON(connection->t_holdtime, bgp_holdtime_timer, peer->v_holdtime); } else { - EVENT_OFF(connection->t_holdtime); + event_cancel(&connection->t_holdtime); } bgp_keepalives_off(connection); - EVENT_OFF(connection->t_routeadv); - EVENT_OFF(connection->t_delayopen); + event_cancel(&connection->t_routeadv); + event_cancel(&connection->t_delayopen); break; case OpenConfirm: /* OpenConfirm status. */ - EVENT_OFF(connection->t_start); - EVENT_OFF(connection->t_connect); + event_cancel(&connection->t_start); + event_cancel(&connection->t_connect); /* * If the negotiated Hold Time value is zero, then the Hold Time @@ -412,7 +412,7 @@ void bgp_timer_set(struct peer_connection *connection) * Additionally if a different hold timer has been negotiated * than we must stop then start the timer again */ - EVENT_OFF(connection->t_holdtime); + event_cancel(&connection->t_holdtime); if (peer->v_holdtime == 0) bgp_keepalives_off(connection); else { @@ -420,16 +420,16 @@ void bgp_timer_set(struct peer_connection *connection) peer->v_holdtime); bgp_keepalives_on(connection); } - EVENT_OFF(connection->t_routeadv); - EVENT_OFF(connection->t_delayopen); + event_cancel(&connection->t_routeadv); + event_cancel(&connection->t_delayopen); break; case Established: /* In Established status start and connect timer is turned off. */ - EVENT_OFF(connection->t_start); - EVENT_OFF(connection->t_connect); - EVENT_OFF(connection->t_delayopen); + event_cancel(&connection->t_start); + event_cancel(&connection->t_connect); + event_cancel(&connection->t_delayopen); /* * Same as OpenConfirm, if holdtime is zero then both holdtime @@ -437,7 +437,7 @@ void bgp_timer_set(struct peer_connection *connection) * Additionally if a different hold timer has been negotiated * then we must stop then start the timer again */ - EVENT_OFF(connection->t_holdtime); + event_cancel(&connection->t_holdtime); if (peer->v_holdtime == 0) bgp_keepalives_off(connection); else { @@ -447,22 +447,22 @@ void bgp_timer_set(struct peer_connection *connection) } break; case Deleted: - EVENT_OFF(peer->connection->t_gr_restart); - EVENT_OFF(peer->connection->t_gr_stale); + event_cancel(&peer->connection->t_gr_restart); + event_cancel(&peer->connection->t_gr_stale); FOREACH_AFI_SAFI (afi, safi) - EVENT_OFF(peer->t_llgr_stale[afi][safi]); + event_cancel(&peer->t_llgr_stale[afi][safi]); - EVENT_OFF(peer->connection->t_pmax_restart); - EVENT_OFF(peer->t_refresh_stalepath); + event_cancel(&peer->connection->t_pmax_restart); + event_cancel(&peer->t_refresh_stalepath); fallthrough; case Clearing: - EVENT_OFF(connection->t_start); - EVENT_OFF(connection->t_connect); - EVENT_OFF(connection->t_holdtime); + event_cancel(&connection->t_start); + event_cancel(&connection->t_connect); + event_cancel(&connection->t_holdtime); bgp_keepalives_off(connection); - EVENT_OFF(connection->t_routeadv); - EVENT_OFF(connection->t_delayopen); + event_cancel(&connection->t_routeadv); + event_cancel(&connection->t_delayopen); break; case BGP_STATUS_MAX: flog_err(EC_LIB_DEVELOPMENT, @@ -493,7 +493,7 @@ static void bgp_connect_timer(struct event *thread) struct peer *peer = connection->peer; /* stop the DelayOpenTimer if it is running */ - EVENT_OFF(connection->t_delayopen); + event_cancel(&connection->t_delayopen); assert(!connection->t_write); assert(!connection->t_read); @@ -634,7 +634,7 @@ static void bgp_graceful_restart_timer_off(struct peer_connection *connection, return; UNSET_FLAG(peer->sflags, PEER_STATUS_NSF_WAIT); - EVENT_OFF(connection->t_gr_stale); + event_cancel(&connection->t_gr_stale); if (peer_dynamic_neighbor(peer) && !(CHECK_FLAG(peer->flags, PEER_FLAG_DELETE))) { @@ -889,8 +889,8 @@ bool bgp_update_delay_configured(struct bgp *bgp) on ending the update delay. */ void bgp_update_delay_end(struct bgp *bgp) { - EVENT_OFF(bgp->t_update_delay); - EVENT_OFF(bgp->t_establish_wait); + event_cancel(&bgp->t_update_delay); + event_cancel(&bgp->t_establish_wait); /* Reset update-delay related state */ bgp->update_delay_over = 1; @@ -956,7 +956,7 @@ void bgp_start_routeadv(struct bgp *bgp) if (!peer_established(connection)) continue; - EVENT_OFF(connection->t_routeadv); + event_cancel(&connection->t_routeadv); BGP_TIMER_ON(connection->t_routeadv, bgp_routeadv_timer, 0); } } @@ -977,7 +977,7 @@ void bgp_adjust_routeadv(struct peer *peer) * different * duration and schedule write thread immediately. */ - EVENT_OFF(connection->t_routeadv); + event_cancel(&connection->t_routeadv); peer->synctime = monotime(NULL); /* If suppress fib pending is enabled, route is advertised to @@ -1009,7 +1009,7 @@ void bgp_adjust_routeadv(struct peer *peer) */ diff = difftime(nowtime, peer->last_update); if (diff > (double)peer->v_routeadv) { - EVENT_OFF(connection->t_routeadv); + event_cancel(&connection->t_routeadv); BGP_TIMER_ON(connection->t_routeadv, bgp_routeadv_timer, 0); return; } @@ -1036,7 +1036,7 @@ void bgp_adjust_routeadv(struct peer *peer) remain = peer->v_routeadv; diff = peer->v_routeadv - diff; if (diff <= (double)remain) { - EVENT_OFF(connection->t_routeadv); + event_cancel(&connection->t_routeadv); BGP_TIMER_ON(connection->t_routeadv, bgp_routeadv_timer, diff); } } @@ -1116,7 +1116,7 @@ static void bgp_maxmed_onstartup_timer(struct event *thread) zlog_info("Max med on startup ended - timer expired."); bgp = EVENT_ARG(thread); - EVENT_OFF(bgp->t_maxmed_onstartup); + event_cancel(&bgp->t_maxmed_onstartup); bgp->maxmed_onstartup_over = 1; bgp_maxmed_update(bgp); @@ -1158,7 +1158,7 @@ static void bgp_update_delay_timer(struct event *thread) zlog_info("Update delay ended - timer expired."); bgp = EVENT_ARG(thread); - EVENT_OFF(bgp->t_update_delay); + event_cancel(&bgp->t_update_delay); bgp_update_delay_end(bgp); } @@ -1170,7 +1170,7 @@ static void bgp_establish_wait_timer(struct event *thread) zlog_info("Establish wait - timer expired."); bgp = EVENT_ARG(thread); - EVENT_OFF(bgp->t_establish_wait); + event_cancel(&bgp->t_establish_wait); bgp_check_update_delay(bgp); } @@ -1407,7 +1407,7 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection) /* graceful restart */ if (connection->t_gr_stale) { - EVENT_OFF(connection->t_gr_stale); + event_cancel(&connection->t_gr_stale); if (bgp_debug_neighbor_events(peer)) zlog_debug("%pBP graceful restart stalepath timer stopped for %s", peer, bgp_peer_get_connection_direction(connection)); @@ -1436,7 +1436,7 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection) /* Stop route-refresh stalepath timer */ if (peer->t_refresh_stalepath) { - EVENT_OFF(peer->t_refresh_stalepath); + event_cancel(&peer->t_refresh_stalepath); if (bgp_debug_neighbor_events(peer)) zlog_debug("%pBP route-refresh restart stalepath timer stopped for %s", @@ -1473,7 +1473,7 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection) gr_info->t_select_deferral); XFREE(MTYPE_TMP, info); } - EVENT_OFF(gr_info->t_select_deferral); + event_cancel(&gr_info->t_select_deferral); gr_info->eor_received = 0; } } @@ -1498,17 +1498,17 @@ enum bgp_fsm_state_progress bgp_stop(struct peer_connection *connection) bgp_writes_off(connection); bgp_reads_off(connection); - EVENT_OFF(connection->t_connect_check_r); - EVENT_OFF(connection->t_connect_check_w); + event_cancel(&connection->t_connect_check_r); + event_cancel(&connection->t_connect_check_w); - EVENT_OFF(connection->t_stop_with_notify); + event_cancel(&connection->t_stop_with_notify); /* Stop all timers. */ - EVENT_OFF(connection->t_start); - EVENT_OFF(connection->t_connect); - EVENT_OFF(connection->t_holdtime); - EVENT_OFF(connection->t_routeadv); - EVENT_OFF(connection->t_delayopen); + event_cancel(&connection->t_start); + event_cancel(&connection->t_connect); + event_cancel(&connection->t_holdtime); + event_cancel(&connection->t_routeadv); + event_cancel(&connection->t_delayopen); /* Clear input and output buffer. */ frr_with_mutex (&connection->io_mtx) { @@ -1667,8 +1667,8 @@ static void bgp_connect_check(struct event *thread) assert(!connection->t_read); assert(!connection->t_write); - EVENT_OFF(connection->t_connect_check_r); - EVENT_OFF(connection->t_connect_check_w); + event_cancel(&connection->t_connect_check_r); + event_cancel(&connection->t_connect_check_w); /* Check file descriptor. */ slen = sizeof(status); @@ -2037,7 +2037,7 @@ static enum bgp_fsm_state_progress bgp_fsm_delayopen_timer_expire(struct peer_connection *connection) { /* Stop the DelayOpenTimer */ - EVENT_OFF(connection->t_delayopen); + event_cancel(&connection->t_delayopen); /* Send open message to peer */ bgp_open_send(connection); @@ -2274,7 +2274,7 @@ bgp_establish(struct peer_connection *connection) else { UNSET_FLAG(peer->sflags, PEER_STATUS_NSF_MODE); if (connection->t_gr_stale) { - EVENT_OFF(connection->t_gr_stale); + event_cancel(&connection->t_gr_stale); if (bgp_debug_neighbor_events(peer)) zlog_debug("%pBP graceful restart stalepath timer stopped for %s", peer, bgp_peer_get_connection_direction(connection)); @@ -2282,7 +2282,7 @@ bgp_establish(struct peer_connection *connection) } if (connection->t_gr_restart) { - EVENT_OFF(connection->t_gr_restart); + event_cancel(&connection->t_gr_restart); if (bgp_debug_neighbor_events(peer)) zlog_debug("%pBP graceful restart timer stopped for %s", peer, bgp_peer_get_connection_direction(connection)); @@ -2299,7 +2299,7 @@ bgp_establish(struct peer_connection *connection) */ FOREACH_AFI_SAFI (afi, safi) { if (peer->t_llgr_stale[afi][safi]) { - EVENT_OFF(peer->t_llgr_stale[afi][safi]); + event_cancel(&peer->t_llgr_stale[afi][safi]); if (bgp_debug_neighbor_events(peer)) zlog_debug("%pBP Long-lived stale timer stopped for afi/safi: %d/%d for %s", peer, afi, safi, @@ -2336,7 +2336,7 @@ bgp_establish(struct peer_connection *connection) * of read-only mode. */ if (!bgp_update_delay_active(peer->bgp)) { - EVENT_OFF(peer->connection->t_routeadv); + event_cancel(&peer->connection->t_routeadv); BGP_TIMER_ON(peer->connection->t_routeadv, bgp_routeadv_timer, 0); } @@ -2374,7 +2374,7 @@ bgp_establish(struct peer_connection *connection) static enum bgp_fsm_state_progress bgp_fsm_keepalive(struct peer_connection *connection) { - EVENT_OFF(connection->t_holdtime); + event_cancel(&connection->t_holdtime); return BGP_FSM_SUCCESS; } @@ -2382,7 +2382,7 @@ bgp_fsm_keepalive(struct peer_connection *connection) static enum bgp_fsm_state_progress bgp_fsm_update(struct peer_connection *connection) { - EVENT_OFF(connection->t_holdtime); + event_cancel(&connection->t_holdtime); return BGP_FSM_SUCCESS; } @@ -2428,13 +2428,13 @@ void bgp_fsm_nht_update(struct peer_connection *connection, struct peer *peer, break; case Connect: if (!has_valid_nexthops) { - EVENT_OFF(connection->t_connect); + event_cancel(&connection->t_connect); BGP_EVENT_ADD(connection, TCP_fatal_error); } break; case Active: if (has_valid_nexthops) { - EVENT_OFF(connection->t_connect); + event_cancel(&connection->t_connect); BGP_EVENT_ADD(connection, ConnectRetry_timer_expired); } break; diff --git a/bgpd/bgp_io.c b/bgpd/bgp_io.c index dac915a73d..eadcfb86b6 100644 --- a/bgpd/bgp_io.c +++ b/bgpd/bgp_io.c @@ -17,7 +17,7 @@ #include "network.h" // for ERRNO_IO_RETRY #include "stream.h" // for stream_get_endp, stream_getw_from, str... #include "ringbuf.h" // for ringbuf_remain, ringbuf_peek, ringbuf_... -#include "frrevent.h" // for EVENT_OFF, EVENT_ARG, thread... +#include "frrevent.h" // for event, EVENT_ARG, thread... #include "bgpd/bgp_io.h" #include "bgpd/bgp_debug.h" // for bgp_debug_neighbor_events, bgp_type_str @@ -68,7 +68,7 @@ void bgp_writes_off(struct peer_connection *connection) assert(fpt->running); event_cancel_async(fpt->master, &connection->t_write, NULL); - EVENT_OFF(connection->t_generate_updgrp_packets); + event_cancel(&connection->t_generate_updgrp_packets); UNSET_FLAG(peer->connection->thread_flags, PEER_THREAD_WRITES_ON); } diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 1dbac2b864..20d281fe28 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -166,7 +166,7 @@ __attribute__((__noreturn__)) void sigint(void) * from the connection_fifo */ peer_connection_fifo_fini(&bm->connection_fifo); - EVENT_OFF(bm->e_process_packet); + event_cancel(&bm->e_process_packet); pthread_mutex_destroy(&bm->peer_connection_mtx); exit(0); diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index 1f4f4d52a2..85ba417637 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -461,7 +461,7 @@ static void bgp_accept(struct event *thread) "[Error] accept() failed with error \"%s\" on BGP listener socket %d for BGP instance in VRF \"%s\"; refreshing socket", safe_strerror(save_errno), accept_sock, VRF_LOGNAME(vrf)); - EVENT_OFF(listener->thread); + event_cancel(&listener->thread); } else { flog_err_sys( EC_LIB_SOCKET, @@ -524,7 +524,7 @@ static void bgp_accept(struct event *thread) } bgp_peer_reg_with_nht(dynamic_peer); bgp_fsm_change_status(incoming, Active); - EVENT_OFF(incoming->t_start); + event_cancel(&incoming->t_start); if (peer_active(incoming) == BGP_PEER_ACTIVE) { if (CHECK_FLAG(dynamic_peer->flags, PEER_FLAG_TIMER_DELAYOPEN)) @@ -661,7 +661,7 @@ static void bgp_accept(struct event *thread) } bgp_peer_reg_with_nht(doppelganger); bgp_fsm_change_status(incoming, Active); - EVENT_OFF(incoming->t_start); /* created in peer_create() */ + event_cancel(&incoming->t_start); /* created in peer_create() */ SET_FLAG(doppelganger->sflags, PEER_STATUS_ACCEPT_PEER); /* Make dummy peer until read Open packet. */ @@ -1074,7 +1074,7 @@ void bgp_close_vrf_socket(struct bgp *bgp) for (ALL_LIST_ELEMENTS(bm->listen_sockets, node, next, listener)) { if (listener->bgp == bgp) { - EVENT_OFF(listener->thread); + event_cancel(&listener->thread); close(listener->fd); listnode_delete(bm->listen_sockets, listener); XFREE(MTYPE_BGP_LISTENER, listener->name); @@ -1096,7 +1096,7 @@ void bgp_close(void) for (ALL_LIST_ELEMENTS(bm->listen_sockets, node, next, listener)) { if (listener->bgp) continue; - EVENT_OFF(listener->thread); + event_cancel(&listener->thread); close(listener->fd); listnode_delete(bm->listen_sockets, listener); XFREE(MTYPE_BGP_LISTENER, listener->name); diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 62a6a4fbab..085fb3064c 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -2531,7 +2531,7 @@ static int bgp_update_receive(struct peer_connection *connection, gr_info->t_select_deferral); XFREE(MTYPE_TMP, info); } - EVENT_OFF(gr_info->t_select_deferral); + event_cancel(&gr_info->t_select_deferral); gr_info->eor_required = 0; gr_info->eor_received = 0; /* Best path selection */ @@ -3055,7 +3055,7 @@ static int bgp_route_refresh_receive(struct peer_connection *connection, return BGP_PACKET_NOOP; } - EVENT_OFF(peer->t_refresh_stalepath); + event_cancel(&peer->t_refresh_stalepath); SET_FLAG(peer->af_sflags[afi][safi], PEER_STATUS_EORR_RECEIVED); UNSET_FLAG(peer->af_sflags[afi][safi], diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index ce6b73ac8e..7a89f97400 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4019,7 +4019,7 @@ void bgp_best_path_select_defer(struct bgp *bgp, afi_t afi, safi_t safi) thread_info = EVENT_ARG(t); XFREE(MTYPE_TMP, thread_info); - EVENT_OFF(bgp->gr_info[afi][safi].t_route_select); + event_cancel(&bgp->gr_info[afi][safi].t_route_select); } if (BGP_DEBUG(graceful_restart, GRACEFUL_RESTART)) { @@ -5914,7 +5914,7 @@ void bgp_stop_announce_route_timer(struct peer_af *paf) if (!paf->t_announce_route) return; - EVENT_OFF(paf->t_announce_route); + event_cancel(&paf->t_announce_route); } /* @@ -6183,7 +6183,7 @@ void bgp_soft_reconfig_table_task_cancel(const struct bgp *bgp, list_delete(&ntable->soft_reconfig_peers); bgp_soft_reconfig_table_flag(ntable, false); - EVENT_OFF(ntable->soft_reconfig_thread); + event_cancel(&ntable->soft_reconfig_thread); } } diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 15ad921ad0..6e34f7b9b4 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -4934,7 +4934,7 @@ static void bgp_route_map_mark_update(const char *rmap_name) /* If new update is received before the current timer timed out, * turn it off and start a new timer. */ - EVENT_OFF(bm->t_rmap_update); + event_cancel(&bm->t_rmap_update); /* rmap_update_timer of 0 means don't do route updates */ if (bm->rmap_update_timer) { diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index aefb58094b..576cf57a74 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -924,7 +924,7 @@ static void stop(struct rpki_vrf *rpki_vrf) { rpki_vrf->rtr_is_stopping = true; if (is_running(rpki_vrf)) { - EVENT_OFF(rpki_vrf->t_rpki_sync); + event_cancel(&rpki_vrf->t_rpki_sync); rtr_mgr_stop(rpki_vrf->rtr_config); rtr_mgr_free(rpki_vrf->rtr_config); rpki_vrf->rtr_is_running = false; diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index d880c7b399..b680cdda27 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -1158,8 +1158,8 @@ static void update_subgroup_delete(struct update_subgroup *subgrp) if (subgrp->update_group) UPDGRP_INCR_STAT(subgrp->update_group, subgrps_deleted); - EVENT_OFF(subgrp->t_merge_check); - EVENT_OFF(subgrp->t_coalesce); + event_cancel(&subgrp->t_merge_check); + event_cancel(&subgrp->t_coalesce); bpacket_queue_cleanup(SUBGRP_PKTQ(subgrp)); subgroup_clear_table(subgrp); @@ -2149,7 +2149,7 @@ void update_group_refresh_default_originate_route_map(struct event *thread) bgp = EVENT_ARG(thread); update_group_walk(bgp, update_group_default_originate_route_map_walkcb, reason); - EVENT_OFF(bgp->t_rmap_def_originate_eval); + event_cancel(&bgp->t_rmap_def_originate_eval); } /* diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 8f816eb30d..f0f7bb2641 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -419,7 +419,7 @@ static void subgroup_coalesce_timer(struct event *thread) peer = PAF_PEER(paf); struct peer_connection *connection = peer->connection; - EVENT_OFF(connection->t_routeadv); + event_cancel(&connection->t_routeadv); BGP_TIMER_ON(connection->t_routeadv, bgp_routeadv_timer, 0); } diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 1df8b4ffe2..85094b74fa 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -2286,7 +2286,7 @@ DEFUN (no_bgp_maxmed_onstartup, /* Cancel max-med onstartup if its on */ if (bgp->t_maxmed_onstartup) { - EVENT_OFF(bgp->t_maxmed_onstartup); + event_cancel(&bgp->t_maxmed_onstartup); bgp->maxmed_onstartup_over = 1; } @@ -8093,7 +8093,7 @@ DEFUN (bgp_set_route_map_delay_timer, * fired. */ if (!rmap_delay_timer && bm->t_rmap_update) { - EVENT_OFF(bm->t_rmap_update); + event_cancel(&bm->t_rmap_update); event_execute(bm->master, bgp_route_map_update_timer, NULL, 0, NULL); } @@ -8505,7 +8505,7 @@ DEFPY (bgp_def_originate_eval, bgp->rmap_def_originate_eval_timer = no ? 0 : timer; if (bgp->t_rmap_def_originate_eval) - EVENT_OFF(bgp->t_rmap_def_originate_eval); + event_cancel(&bgp->t_rmap_def_originate_eval); return CMD_SUCCESS; } @@ -20293,7 +20293,7 @@ static void bgp_config_end_timeout(struct event *t) static void bgp_config_start(void) { - EVENT_OFF(t_bgp_cfg); + event_cancel(&t_bgp_cfg); event_add_timer(bm->master, bgp_config_end_timeout, NULL, BGP_PRE_CONFIG_MAX_WAIT_SECONDS, &t_bgp_cfg); } @@ -20317,7 +20317,7 @@ static void bgp_config_end(void) if (!bgp_config_inprocess()) return; - EVENT_OFF(t_bgp_cfg); + event_cancel(&t_bgp_cfg); /* Start a new timer to make sure we don't send EoR * before route-maps are processed. diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 83f8057736..1d5e0174e8 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -2672,16 +2672,16 @@ void peer_nsf_stop(struct peer *peer) FOREACH_AFI_SAFI_NSF (afi, safi) { peer->nsf[afi][safi] = 0; - EVENT_OFF(peer->t_llgr_stale[afi][safi]); + event_cancel(&peer->t_llgr_stale[afi][safi]); } if (peer->connection->t_gr_restart) { - EVENT_OFF(peer->connection->t_gr_restart); + event_cancel(&peer->connection->t_gr_restart); if (bgp_debug_neighbor_events(peer)) zlog_debug("%pBP graceful restart timer stopped", peer); } if (peer->connection->t_gr_stale) { - EVENT_OFF(peer->connection->t_gr_stale); + event_cancel(&peer->connection->t_gr_stale); if (bgp_debug_neighbor_events(peer)) zlog_debug( "%pBP graceful restart stalepath timer stopped", @@ -4009,7 +4009,7 @@ void bgp_instance_down(struct bgp *bgp) /* Stop timers. */ if (bgp->t_rmap_def_originate_eval) - EVENT_OFF(bgp->t_rmap_def_originate_eval); + event_cancel(&bgp->t_rmap_def_originate_eval); /* Bring down peers, so corresponding routes are purged. */ for (ALL_LIST_ELEMENTS(bgp->peer, node, next, peer)) { @@ -4147,14 +4147,14 @@ int bgp_delete(struct bgp *bgp) hook_call(bgp_inst_delete, bgp); FOREACH_AFI_SAFI (afi, safi) - EVENT_OFF(bgp->t_revalidate[afi][safi]); + event_cancel(&bgp->t_revalidate[afi][safi]); - EVENT_OFF(bgp->t_condition_check); - EVENT_OFF(bgp->t_startup); - EVENT_OFF(bgp->t_maxmed_onstartup); - EVENT_OFF(bgp->t_update_delay); - EVENT_OFF(bgp->t_establish_wait); - EVENT_OFF(bgp->clearing_end); + event_cancel(&bgp->t_condition_check); + event_cancel(&bgp->t_startup); + event_cancel(&bgp->t_maxmed_onstartup); + event_cancel(&bgp->t_update_delay); + event_cancel(&bgp->t_establish_wait); + event_cancel(&bgp->clearing_end); /* Set flag indicating bgp instance delete in progress */ SET_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS); @@ -4172,7 +4172,7 @@ int bgp_delete(struct bgp *bgp) XFREE(MTYPE_TMP, info); } - EVENT_OFF(gr_info->t_select_deferral); + event_cancel(&gr_info->t_select_deferral); t = gr_info->t_route_select; if (t) { @@ -4180,7 +4180,7 @@ int bgp_delete(struct bgp *bgp) XFREE(MTYPE_TMP, info); } - EVENT_OFF(gr_info->t_route_select); + event_cancel(&gr_info->t_route_select); } /* Delete route flap dampening configuration */ @@ -4218,7 +4218,7 @@ int bgp_delete(struct bgp *bgp) /* Stop timers. */ if (bgp->t_rmap_def_originate_eval) - EVENT_OFF(bgp->t_rmap_def_originate_eval); + event_cancel(&bgp->t_rmap_def_originate_eval); /* Inform peers we're going down. */ for (ALL_LIST_ELEMENTS(bgp->peer, node, next, peer)) @@ -4273,7 +4273,7 @@ int bgp_delete(struct bgp *bgp) update_bgp_group_free(bgp); /* Cancel peer connection errors event */ - EVENT_OFF(bgp->t_conn_errors); + event_cancel(&bgp->t_conn_errors); /* Cleanup for peer connection batching */ while ((cinfo = bgp_clearing_info_pop(&bgp->clearing_list)) != NULL) @@ -5052,7 +5052,7 @@ static void peer_flag_modify_action(struct peer *peer, uint64_t flag) UNSET_FLAG(peer->sflags, PEER_STATUS_PREFIX_OVERFLOW); if (peer->connection->t_pmax_restart) { - EVENT_OFF(peer->connection->t_pmax_restart); + event_cancel(&peer->connection->t_pmax_restart); if (bgp_debug_neighbor_events(peer)) zlog_debug( "%pBP Maximum-prefix restart timer canceled", @@ -8040,7 +8040,7 @@ static bool peer_maximum_prefix_clear_overflow(struct peer *peer) UNSET_FLAG(peer->sflags, PEER_STATUS_PREFIX_OVERFLOW); if (peer->connection->t_pmax_restart) { - EVENT_OFF(peer->connection->t_pmax_restart); + event_cancel(&peer->connection->t_pmax_restart); if (bgp_debug_neighbor_events(peer)) zlog_debug( "%pBP Maximum-prefix restart timer cancelled", @@ -8964,12 +8964,12 @@ void bgp_terminate(void) if (bm->listen_sockets) list_delete(&bm->listen_sockets); - EVENT_OFF(bm->t_rmap_update); - EVENT_OFF(bm->t_bgp_sync_label_manager); - EVENT_OFF(bm->t_bgp_start_label_manager); - EVENT_OFF(bm->t_bgp_zebra_route); - EVENT_OFF(bm->t_bgp_zebra_l2_vni); - EVENT_OFF(bm->t_bgp_zebra_l3_vni); + event_cancel(&bm->t_rmap_update); + event_cancel(&bm->t_bgp_sync_label_manager); + event_cancel(&bm->t_bgp_start_label_manager); + event_cancel(&bm->t_bgp_zebra_route); + event_cancel(&bm->t_bgp_zebra_l2_vni); + event_cancel(&bm->t_bgp_zebra_l3_vni); bgp_mac_finish(); #ifdef ENABLE_BGP_VNC @@ -9184,7 +9184,7 @@ void bgp_clearing_batch_end_event_start(struct bgp *bgp) if (!event_is_scheduled(bgp->clearing_end)) bgp_lock(bgp); - EVENT_OFF(bgp->clearing_end); + event_cancel(&bgp->clearing_end); event_add_timer_msec(bm->master, bgp_clearing_batch_end_event, bgp, 100, &bgp->clearing_end); } diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 0d5a18afbb..b57e6e9f78 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -850,7 +850,7 @@ static void rfapiBgpInfoChainFree(struct bgp_path_info *bpi) rwcb_del(&_rwcbhash, wcb); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - EVENT_OFF(bpi->extra->vnc->vnc.import.timer); + event_cancel(&bpi->extra->vnc->vnc.import.timer); } next = bpi->next; @@ -3088,7 +3088,7 @@ static void rfapiBgpInfoFilteredImportEncap( rwcb_del(&_rwcbhash, wcb); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - EVENT_OFF(bpi->extra->vnc->vnc.import + event_cancel(&bpi->extra->vnc->vnc.import .timer); } @@ -3182,7 +3182,7 @@ static void rfapiBgpInfoFilteredImportEncap( rwcb_del(&_rwcbhash, wcb); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - EVENT_OFF(bpi->extra->vnc->vnc.import.timer); + event_cancel(&bpi->extra->vnc->vnc.import.timer); } rfapiExpireEncapNow(import_table, rn, bpi); } @@ -3545,7 +3545,7 @@ void rfapiBgpInfoFilteredImportVPN( rwcb_del(&_rwcbhash, wcb); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - EVENT_OFF(bpi->extra->vnc->vnc.import + event_cancel(&bpi->extra->vnc->vnc.import .timer); import_table->holddown_count[afi] -= 1; @@ -3765,7 +3765,7 @@ void rfapiBgpInfoFilteredImportVPN( rwcb_del(&_rwcbhash, wcb); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - EVENT_OFF(bpi->extra->vnc->vnc.import.timer); + event_cancel(&bpi->extra->vnc->vnc.import.timer); } rfapiExpireVpnNow(import_table, rn, bpi, 0); } @@ -4518,7 +4518,7 @@ static void rfapiDeleteRemotePrefixesIt( rwcb_del(&_rwcbhash, wcb); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - EVENT_OFF(bpi->extra->vnc->vnc + event_cancel(&bpi->extra->vnc->vnc .import.timer); } } else { @@ -4862,7 +4862,7 @@ void rfapi_import_terminate(void) while ((wcb = rwcb_pop(&_rwcbhash))) { bpi = wcb->info; assert(wcb == EVENT_ARG(bpi->extra->vnc->vnc.import.timer)); - EVENT_OFF(bpi->extra->vnc->vnc.import.timer); + event_cancel(&bpi->extra->vnc->vnc.import.timer); timer_service_func = wcb->timer_service_func; memset(&t, 0, sizeof(t)); diff --git a/bgpd/rfapi/rfapi_monitor.c b/bgpd/rfapi/rfapi_monitor.c index 146e0d18b5..83e8afa0e5 100644 --- a/bgpd/rfapi/rfapi_monitor.c +++ b/bgpd/rfapi/rfapi_monitor.c @@ -619,7 +619,7 @@ void rfapiMonitorDel(struct bgp *bgp, struct rfapi_descriptor *rfd, rfapiMonitorDetachImport(m); } - EVENT_OFF(m->timer); + event_cancel(&m->timer); /* * remove from rfd list @@ -656,7 +656,7 @@ int rfapiMonitorDelHd(struct rfapi_descriptor *rfd) rfapiMonitorDetachImport(m); } - EVENT_OFF(m->timer); + event_cancel(&m->timer); XFREE(MTYPE_RFAPI_MONITOR, m); rn->info = NULL; @@ -690,7 +690,7 @@ int rfapiMonitorDelHd(struct rfapi_descriptor *rfd) #endif } - EVENT_OFF(mon_eth->timer); + event_cancel(&mon_eth->timer); /* * remove from rfd list @@ -753,7 +753,7 @@ static void rfapiMonitorTimerRestart(struct rfapi_monitor_vpn *m) if (m->rfd->response_lifetime - remain < 2) return; - EVENT_OFF(m->timer); + event_cancel(&m->timer); { char buf[BUFSIZ]; @@ -1061,7 +1061,7 @@ static void rfapiMonitorEthTimerRestart(struct rfapi_monitor_eth *m) if (m->rfd->response_lifetime - remain < 2) return; - EVENT_OFF(m->timer); + event_cancel(&m->timer); { char buf[BUFSIZ]; @@ -1399,7 +1399,7 @@ void rfapiMonitorEthDel(struct bgp *bgp, struct rfapi_descriptor *rfd, rfapiMonitorEthDetachImport(bgp, val); } - EVENT_OFF(val->timer); + event_cancel(&val->timer); /* * remove from rfd list diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index fe6ad50f92..9a3d56b061 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -292,7 +292,7 @@ static void rfapi_info_free(struct rfapi_info *goner) #if DEBUG_CLEANUP zlog_debug("%s: ri %p, tcb %p", __func__, goner, tcb); #endif - EVENT_OFF(goner->timer); + event_cancel(&goner->timer); rrtcb_del(&_rrtcbhash, tcb); XFREE(MTYPE_RFAPI_RECENT_DELETE, tcb); } @@ -357,7 +357,7 @@ static void rfapiRibStartTimer(struct rfapi_descriptor *rfd, if (ri->timer) { tcb = EVENT_ARG(ri->timer); - EVENT_OFF(ri->timer); + event_cancel(&ri->timer); } else { tcb = XCALLOC(MTYPE_RFAPI_RECENT_DELETE, sizeof(struct rfapi_rib_tcb)); @@ -554,7 +554,7 @@ void rfapiRibClear(struct rfapi_descriptor *rfd) tcb = EVENT_ARG( ri->timer); - EVENT_OFF(ri->timer); + event_cancel(&ri->timer); rrtcb_del(&_rrtcbhash, tcb); XFREE(MTYPE_RFAPI_RECENT_DELETE, tcb); @@ -938,7 +938,7 @@ static void process_pending_node(struct bgp *bgp, struct rfapi_descriptor *rfd, struct rfapi_rib_tcb *tcb; tcb = EVENT_ARG(ri->timer); - EVENT_OFF(ri->timer); + event_cancel(&ri->timer); rrtcb_del(&_rrtcbhash, tcb); XFREE(MTYPE_RFAPI_RECENT_DELETE, tcb); } @@ -1024,7 +1024,7 @@ static void process_pending_node(struct bgp *bgp, struct rfapi_descriptor *rfd, struct rfapi_rib_tcb *tcb; tcb = EVENT_ARG(ori->timer); - EVENT_OFF(ori->timer); + event_cancel(&ori->timer); rrtcb_del(&_rrtcbhash, tcb); XFREE(MTYPE_RFAPI_RECENT_DELETE, tcb); } @@ -1360,7 +1360,7 @@ callback: struct rfapi_rib_tcb *tcb; tcb = EVENT_ARG(ri->timer); - EVENT_OFF(ri->timer); + event_cancel(&ri->timer); rrtcb_del(&_rrtcbhash, tcb); XFREE(MTYPE_RFAPI_RECENT_DELETE, tcb); } @@ -2466,7 +2466,7 @@ void rfapi_rib_terminate(void) */ while ((tcb = rrtcb_pop(&_rrtcbhash))) { assert(tcb == EVENT_ARG(tcb->ri->timer)); - EVENT_OFF(tcb->ri->timer); + event_cancel(&tcb->ri->timer); _rfapiRibExpireTimer(tcb); /* deletes hash entry, frees tcb */ } } diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c index c9a058ea44..85f0de8cd0 100644 --- a/bgpd/rfapi/vnc_export_bgp.c +++ b/bgpd/rfapi/vnc_export_bgp.c @@ -1689,7 +1689,7 @@ void vnc_direct_bgp_rh_add_route(struct bgp *bgp, afi_t afi, * export expiration timer is already running on * this route: cancel it */ - EVENT_OFF(eti->timer); + event_cancel(&eti->timer); bgp_update(peer, prefix, /* prefix */ 0, /* addpath_id */ @@ -1918,7 +1918,7 @@ void vnc_direct_bgp_rh_vpn_enable(struct bgp *bgp, afi_t afi) * already running on * this route: cancel it */ - EVENT_OFF(eti->timer); + event_cancel(&eti->timer); vnc_zlog_debug_verbose( "%s: calling bgp_update", @@ -1987,7 +1987,7 @@ void vnc_direct_bgp_rh_vpn_disable(struct bgp *bgp, afi_t afi) ZEBRA_ROUTE_VNC_DIRECT_RH, BGP_ROUTE_REDISTRIBUTE); if (eti) { - EVENT_OFF(eti->timer); + event_cancel(&eti->timer); vnc_eti_delete(eti); } diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index 116a697de9..df5226085f 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -560,8 +560,8 @@ static void fpm_reconnect(struct fpm_nl_ctx *fnc) stream_reset(fnc->ibuf); stream_reset(fnc->obuf); - EVENT_OFF(fnc->t_read); - EVENT_OFF(fnc->t_write); + event_cancel(&fnc->t_read); + event_cancel(&fnc->t_write); /* Reset the barrier value */ cleaning_p = true; @@ -1572,7 +1572,7 @@ static void fpm_process_queue(struct event *t) event_add_timer(fnc->fthread->master, fpm_process_wedged, fnc, DPLANE_FPM_NL_WEDGIE_TIME, &fnc->t_wedged); } else - EVENT_OFF(fnc->t_wedged); + event_cancel(&fnc->t_wedged); /* * Let the dataplane thread know if there are items in the @@ -1685,16 +1685,16 @@ static int fpm_nl_finish_early(struct fpm_nl_ctx *fnc) return 0; /* Disable all events and close socket. */ - EVENT_OFF(fnc->t_lspreset); - EVENT_OFF(fnc->t_lspwalk); - EVENT_OFF(fnc->t_nhgreset); - EVENT_OFF(fnc->t_nhgwalk); - EVENT_OFF(fnc->t_ribreset); - EVENT_OFF(fnc->t_ribwalk); - EVENT_OFF(fnc->t_rmacreset); - EVENT_OFF(fnc->t_rmacwalk); - EVENT_OFF(fnc->t_event); - EVENT_OFF(fnc->t_nhg); + event_cancel(&fnc->t_lspreset); + event_cancel(&fnc->t_lspwalk); + event_cancel(&fnc->t_nhgreset); + event_cancel(&fnc->t_nhgwalk); + event_cancel(&fnc->t_ribreset); + event_cancel(&fnc->t_ribwalk); + event_cancel(&fnc->t_rmacreset); + event_cancel(&fnc->t_rmacwalk); + event_cancel(&fnc->t_event); + event_cancel(&fnc->t_nhg); event_cancel_async(fnc->fthread->master, &fnc->t_read, NULL); event_cancel_async(fnc->fthread->master, &fnc->t_write, NULL); event_cancel_async(fnc->fthread->master, &fnc->t_connect, NULL); diff --git a/zebra/interface.c b/zebra/interface.c index f836b3ab35..6d5aff5162 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -233,7 +233,7 @@ static int if_zebra_delete_hook(struct interface *ifp) XFREE(MTYPE_ZIF_DESC, zebra_if->desc); - EVENT_OFF(zebra_if->speed_update); + event_cancel(&zebra_if->speed_update); XFREE(MTYPE_ZINFO, zebra_if); } diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c index 349ae1a191..6d543fb7d0 100644 --- a/zebra/irdp_main.c +++ b/zebra/irdp_main.c @@ -242,7 +242,7 @@ void irdp_advert_off(struct interface *ifp) if (!irdp) return; - EVENT_OFF(irdp->t_advertise); + event_cancel(&irdp->t_advertise); frr_each (if_connected, ifp->connected, ifc) { p = ifc->address; @@ -279,7 +279,7 @@ void process_solicit(struct interface *ifp) return; irdp->flags |= IF_SOLICIT; - EVENT_OFF(irdp->t_advertise); + event_cancel(&irdp->t_advertise); timer = (frr_weak_random() % MAX_RESPONSE_DELAY) + 1; diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 0c607dfa67..f1564297cc 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -1983,7 +1983,7 @@ static void kernel_nlsock_fini(struct nlsock *nls) void kernel_terminate(struct zebra_ns *zns, bool complete) { - EVENT_OFF(zns->t_netlink); + event_cancel(&zns->t_netlink); kernel_nlsock_fini(&zns->netlink); diff --git a/zebra/rtadv.c b/zebra/rtadv.c index f632938f69..1a9d13a178 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -1593,7 +1593,7 @@ void rtadv_stop_ra(struct interface *ifp) wheel_remove_item(zrouter.ra_wheel, ifp); /*Turn off event for ICMPv6 join*/ - EVENT_OFF(zif->icmpv6_join_timer); + event_cancel(&zif->icmpv6_join_timer); if (zif->rtadv.AdvSendAdvertisements) rtadv_send_packet(zvrf->rtadv.sock, ifp, RA_SUPPRESS); @@ -1980,8 +1980,8 @@ static void rtadv_event(struct zebra_vrf *zvrf, enum rtadv_event event, int val) break; case RTADV_STOP: - EVENT_OFF(rtadv->ra_timer); - EVENT_OFF(rtadv->ra_read); + event_cancel(&rtadv->ra_timer); + event_cancel(&rtadv->ra_read); break; case RTADV_TIMER: event_add_timer(zrouter.master, rtadv_timer, zvrf, val, diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index a6d43daa93..f6a5ee58ae 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -7331,8 +7331,8 @@ static void dplane_check_shutdown_status(struct event *event) zns_info_list_del(&zdplane_info.dg_zns_list, zi); if (zdplane_info.dg_master) { - EVENT_OFF(zi->t_read); - EVENT_OFF(zi->t_request); + event_cancel(&zi->t_read); + event_cancel(&zi->t_request); } XFREE(MTYPE_DP_NS, zi); diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index 3fd84b5257..037e5365ee 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -570,7 +570,7 @@ static void zebra_evpn_dup_addr_detect_for_mac(struct zebra_vrf *zvrf, } /* Start auto recovery timer for this MAC */ - EVENT_OFF(mac->dad_mac_auto_recovery_timer); + event_cancel(&mac->dad_mac_auto_recovery_timer); if (zvrf->dad_freeze && zvrf->dad_freeze_time) { if (IS_ZEBRA_DEBUG_VXLAN) { char mac_buf[MAC_BUF_SIZE]; @@ -1134,7 +1134,7 @@ int zebra_evpn_mac_del(struct zebra_evpn *zevpn, struct zebra_mac *mac) zebra_evpn_mac_stop_hold_timer(mac); /* Cancel auto recovery */ - EVENT_OFF(mac->dad_mac_auto_recovery_timer); + event_cancel(&mac->dad_mac_auto_recovery_timer); /* If the MAC is freed before the neigh we will end up * with a stale pointer against the neigh. @@ -1562,7 +1562,7 @@ void zebra_evpn_mac_stop_hold_timer(struct zebra_mac *mac) sizeof(mac_buf))); } - EVENT_OFF(mac->hold_timer); + event_cancel(&mac->hold_timer); } void zebra_evpn_sync_mac_del(struct zebra_mac *mac) diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index bc477266d3..5a40ed8a7e 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -2345,7 +2345,7 @@ static void zebra_evpn_es_local_info_clear(struct zebra_evpn_es **esp) es->flags &= ~(ZEBRA_EVPNES_LOCAL | ZEBRA_EVPNES_READY_FOR_BGP); - EVENT_OFF(es->df_delay_timer); + event_cancel(&es->df_delay_timer); /* clear EVPN protodown flags on the access port */ zebra_evpn_mh_clear_protodown_es(es); @@ -3741,7 +3741,7 @@ static void zebra_evpn_mh_startup_delay_timer_start(const char *rc) if (zmh_info->startup_delay_timer) { if (IS_ZEBRA_DEBUG_EVPN_MH_ES) zlog_debug("startup-delay timer cancelled"); - EVENT_OFF(zmh_info->startup_delay_timer); + event_cancel(&zmh_info->startup_delay_timer); } if (zmh_info->startup_delay_time) { diff --git a/zebra/zebra_evpn_neigh.c b/zebra/zebra_evpn_neigh.c index 81705d4e85..e06dd23c38 100644 --- a/zebra/zebra_evpn_neigh.c +++ b/zebra/zebra_evpn_neigh.c @@ -580,7 +580,7 @@ int zebra_evpn_neigh_del(struct zebra_evpn *zevpn, struct zebra_neigh *n) listnode_delete(n->mac->neigh_list, n); /* Cancel auto recovery */ - EVENT_OFF(n->dad_ip_auto_recovery_timer); + event_cancel(&n->dad_ip_auto_recovery_timer); /* Cancel proxy hold timer */ zebra_evpn_neigh_stop_hold_timer(n); @@ -1223,7 +1223,7 @@ static void zebra_evpn_dup_addr_detect_for_neigh( nbr->dad_dup_detect_time = monotime(NULL); /* Start auto recovery timer for this IP */ - EVENT_OFF(nbr->dad_ip_auto_recovery_timer); + event_cancel(&nbr->dad_ip_auto_recovery_timer); if (zvrf->dad_freeze && zvrf->dad_freeze_time) { if (IS_ZEBRA_DEBUG_VXLAN) zlog_debug( @@ -1683,7 +1683,7 @@ void zebra_evpn_clear_dup_neigh_hash(struct hash_bucket *bucket, void *ctxt) nbr->detect_start_time.tv_sec = 0; nbr->detect_start_time.tv_usec = 0; nbr->dad_dup_detect_time = 0; - EVENT_OFF(nbr->dad_ip_auto_recovery_timer); + event_cancel(&nbr->dad_ip_auto_recovery_timer); if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_LOCAL)) { zebra_evpn_neigh_send_add_to_client(zevpn->vni, &nbr->ip, diff --git a/zebra/zebra_evpn_neigh.h b/zebra/zebra_evpn_neigh.h index c82b3673b1..21d1d1cc97 100644 --- a/zebra/zebra_evpn_neigh.h +++ b/zebra/zebra_evpn_neigh.h @@ -158,7 +158,7 @@ static inline void zebra_evpn_neigh_stop_hold_timer(struct zebra_neigh *n) if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH) zlog_debug("sync-neigh vni %u ip %pIA mac %pEA 0x%x hold stop", n->zevpn->vni, &n->ip, &n->emac, n->flags); - EVENT_OFF(n->hold_timer); + event_cancel(&n->hold_timer); } void zebra_evpn_sync_neigh_static_chg(struct zebra_neigh *n, bool old_n_static, diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 92dc591d40..e2fb1c64ab 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -485,7 +485,7 @@ static inline void zfpm_write_on(void) */ static inline void zfpm_read_off(void) { - EVENT_OFF(zfpm_g->t_read); + event_cancel(&zfpm_g->t_read); } /* @@ -493,17 +493,17 @@ static inline void zfpm_read_off(void) */ static inline void zfpm_write_off(void) { - EVENT_OFF(zfpm_g->t_write); + event_cancel(&zfpm_g->t_write); } static inline void zfpm_connect_off(void) { - EVENT_OFF(zfpm_g->t_connect); + event_cancel(&zfpm_g->t_connect); } static inline void zfpm_conn_down_off(void) { - EVENT_OFF(zfpm_g->t_conn_down); + event_cancel(&zfpm_g->t_conn_down); } /* @@ -577,7 +577,7 @@ static void zfpm_connection_up(const char *detail) /* * Start thread to push existing routes to the FPM. */ - EVENT_OFF(zfpm_g->t_conn_up); + event_cancel(&zfpm_g->t_conn_up); zfpm_rnodes_iter_init(&zfpm_g->t_conn_up_state.iter); zfpm_g->fpm_mac_dump_done = false; @@ -1703,7 +1703,7 @@ static void zfpm_stop_stats_timer(void) return; zfpm_debug("Stopping existing stats timer"); - EVENT_OFF(zfpm_g->t_stats); + event_cancel(&zfpm_g->t_stats); } /* diff --git a/zebra/zebra_gr.c b/zebra/zebra_gr.c index 3be9512c77..7cb6030062 100644 --- a/zebra/zebra_gr.c +++ b/zebra/zebra_gr.c @@ -77,7 +77,7 @@ void zebra_gr_stale_client_cleanup(void) /* Cancel the stale timer */ if (info->t_stale_removal != NULL) { - EVENT_OFF(info->t_stale_removal); + event_cancel(&info->t_stale_removal); info->do_delete = true; /* Process the stale routes */ event_execute( @@ -115,7 +115,7 @@ static void zebra_gr_client_info_delete(struct zserv *client, TAILQ_REMOVE(&(client->gr_info_queue), info, gr_info); - EVENT_OFF(info->t_stale_removal); + event_cancel(&info->t_stale_removal); LOG_GR("%s: Instance info is being deleted for client %s vrf %s(%u)", __func__, zebra_route_string(client->proto), VRF_LOGNAME(vrf), @@ -669,7 +669,7 @@ static void zebra_gr_process_client_stale_routes(struct zserv *client, LOG_GR("%s: Client %s route update complete for all AFI/SAFI in vrf %s(%d)", __func__, zebra_route_string(client->proto), VRF_LOGNAME(vrf), info->vrf_id); - EVENT_OFF(info->t_stale_removal); + event_cancel(&info->t_stale_removal); } } diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index 52b94e0405..f12a52a94c 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -459,7 +459,7 @@ void zebra_ns_notify_close(void) fd = zebra_netns_notify_current->u.fd; if (zebra_netns_notify_current->master != NULL) - EVENT_OFF(zebra_netns_notify_current); + event_cancel(&zebra_netns_notify_current); /* auto-removal of notify items */ if (fd > 0) diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 1da2c13c15..68ffbb7654 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1711,7 +1711,7 @@ void zebra_nhg_free(struct nhg_hash_entry *nhe) nhe->nhg.nexthop); } - EVENT_OFF(nhe->timer); + event_cancel(&nhe->timer); zebra_nhg_free_members(nhe); @@ -1736,7 +1736,7 @@ void zebra_nhg_hash_free(void *p) nhe->nhg.nexthop); } - EVENT_OFF(nhe->timer); + event_cancel(&nhe->timer); nexthops_free(nhe->nhg.nexthop); @@ -1821,7 +1821,7 @@ void zebra_nhg_increment_ref(struct nhg_hash_entry *nhe) nhe->refcnt++; if (event_is_scheduled(nhe->timer)) { - EVENT_OFF(nhe->timer); + event_cancel(&nhe->timer); nhe->refcnt--; UNSET_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND); } @@ -3847,7 +3847,7 @@ struct nhg_hash_entry *zebra_nhg_proto_add(uint32_t id, int type, /* Dont call the dec API, we dont want to uninstall the ID */ old->refcnt = 0; - EVENT_OFF(old->timer); + event_cancel(&old->timer); zebra_nhg_free(old); old = NULL; } diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 9188921fe4..46b72e7cf1 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -140,9 +140,9 @@ void zebra_ptm_finish(void) free(ptm_cb.in_data); /* Cancel events. */ - EVENT_OFF(ptm_cb.t_read); - EVENT_OFF(ptm_cb.t_write); - EVENT_OFF(ptm_cb.t_timer); + event_cancel(&ptm_cb.t_read); + event_cancel(&ptm_cb.t_write); + event_cancel(&ptm_cb.t_timer); if (ptm_cb.wb) buffer_free(ptm_cb.wb); @@ -196,7 +196,7 @@ static int zebra_ptm_send_message(char *data, int size) ptm_cb.reconnect_time, &ptm_cb.t_timer); return -1; case BUFFER_EMPTY: - EVENT_OFF(ptm_cb.t_write); + event_cancel(&ptm_cb.t_write); break; case BUFFER_PENDING: event_add_write(zrouter.master, zebra_ptm_flush_messages, NULL, diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c index 6adc0b1b4a..b7caa99628 100644 --- a/zebra/zebra_pw.c +++ b/zebra/zebra_pw.c @@ -89,7 +89,7 @@ void zebra_pw_del(struct zebra_vrf *zvrf, struct zebra_pw *pw) dplane_pw_uninstall(pw); } - EVENT_OFF(pw->install_retry_timer); + event_cancel(&pw->install_retry_timer); /* unlink and release memory */ RB_REMOVE(zebra_pw_head, &zvrf->pseudowires, pw); @@ -232,7 +232,7 @@ void zebra_pw_install_failure(struct zebra_pw *pw, int pwstatus) pw->vrf_id, pw->ifname, PW_INSTALL_RETRY_INTERVAL); /* schedule to retry later */ - EVENT_OFF(pw->install_retry_timer); + event_cancel(&pw->install_retry_timer); event_add_timer(zrouter.master, zebra_pw_install_retry, pw, PW_INSTALL_RETRY_INTERVAL, &pw->install_retry_timer); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 77e3eb9e46..200c181713 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -4832,7 +4832,7 @@ void rib_update_finish(void) ctx = EVENT_ARG(t_rib_update_threads[i]); rib_update_ctx_fini(&ctx); - EVENT_OFF(t_rib_update_threads[i]); + event_cancel(&t_rib_update_threads[i]); } } } @@ -5302,7 +5302,7 @@ void zebra_rib_terminate(void) { struct zebra_dplane_ctx *ctx; - EVENT_OFF(t_dplane); + event_cancel(&t_dplane); ctx = dplane_ctx_dequeue(&rib_dplane_q); while (ctx) { diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 2813f037a2..b83fadffe0 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -1183,7 +1183,7 @@ void zebra_route_map_set_delay_timer(uint32_t value) if (!value && zebra_t_rmap_update) { /* Event driven route map updates is being disabled */ /* But there's a pending timer. Fire it off now */ - EVENT_OFF(zebra_t_rmap_update); + event_cancel(&zebra_t_rmap_update); zebra_route_map_update_timer(NULL); } } @@ -1193,7 +1193,7 @@ void zebra_routemap_finish(void) /* Set zebra_rmap_update_timer to 0 so that it wont schedule again */ zebra_rmap_update_timer = 0; /* Thread off if any scheduled already */ - EVENT_OFF(zebra_t_rmap_update); + event_cancel(&zebra_t_rmap_update); route_map_finish(); } @@ -1295,7 +1295,7 @@ static void zebra_route_map_mark_update(const char *rmap_name) { /* rmap_update_timer of 0 means don't do route updates */ if (zebra_rmap_update_timer) - EVENT_OFF(zebra_t_rmap_update); + event_cancel(&zebra_t_rmap_update); event_add_timer(zrouter.master, zebra_route_map_update_timer, NULL, zebra_rmap_update_timer, &zebra_t_rmap_update); diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index 15b7e317c9..c3a3b040df 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -237,7 +237,7 @@ void zebra_router_terminate(void) zrouter.ra_wheel = NULL; } - EVENT_OFF(zrouter.t_rib_sweep); + event_cancel(&zrouter.t_rib_sweep); RB_FOREACH_SAFE (zrt, zebra_router_table_head, &zrouter.tables, tmp) zebra_router_free_table(zrt); diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 1dd212cea1..74b678b37a 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3515,7 +3515,7 @@ int zebra_vxlan_clear_dup_detect_vni_mac(struct zebra_vrf *zvrf, vni_t vni, mac->detect_start_time.tv_sec = 0; mac->detect_start_time.tv_usec = 0; mac->dad_dup_detect_time = 0; - EVENT_OFF(mac->dad_mac_auto_recovery_timer); + event_cancel(&mac->dad_mac_auto_recovery_timer); /* warn-only action return */ if (!zvrf->dad_freeze) @@ -3597,7 +3597,7 @@ int zebra_vxlan_clear_dup_detect_vni_ip(struct zebra_vrf *zvrf, vni_t vni, nbr->detect_start_time.tv_sec = 0; nbr->detect_start_time.tv_usec = 0; nbr->dad_dup_detect_time = 0; - EVENT_OFF(nbr->dad_ip_auto_recovery_timer); + event_cancel(&nbr->dad_ip_auto_recovery_timer); if (!!CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_LOCAL)) { zebra_evpn_neigh_send_add_to_client(zevpn->vni, ip, &nbr->emac, @@ -3632,7 +3632,7 @@ static void zevpn_clear_dup_mac_hash(struct hash_bucket *bucket, void *ctxt) mac->detect_start_time.tv_sec = 0; mac->detect_start_time.tv_usec = 0; mac->dad_dup_detect_time = 0; - EVENT_OFF(mac->dad_mac_auto_recovery_timer); + event_cancel(&mac->dad_mac_auto_recovery_timer); /* Remove all IPs as duplicate associcated with this MAC */ for (ALL_LIST_ELEMENTS_RO(mac->neigh_list, node, nbr)) { diff --git a/zebra/zserv.c b/zebra/zserv.c index 228756a843..55a5cb534b 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -190,8 +190,8 @@ static void zserv_client_fail(struct zserv *client) atomic_store_explicit(&client->pthread->running, false, memory_order_relaxed); - EVENT_OFF(client->t_read); - EVENT_OFF(client->t_write); + event_cancel(&client->t_read); + event_cancel(&client->t_write); zserv_event(client, ZSERV_HANDLE_CLIENT_FAIL); } @@ -718,8 +718,8 @@ void zserv_close_client(struct zserv *client) zebra_route_string(client->proto)); event_cancel_event(zrouter.master, client); - EVENT_OFF(client->t_cleanup); - EVENT_OFF(client->t_process); + event_cancel(&client->t_cleanup); + event_cancel(&client->t_process); /* destroy pthread */ frr_pthread_destroy(client->pthread); -- 2.39.5