From: Mark Stapp Date: Tue, 29 Apr 2025 18:26:25 +0000 (-0400) Subject: lib,mgmtd,nhrpd: remove use of the EVENT_OFF macro X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=64f635c2bc41334cfe51b2a70dc901500d7696a6;p=mirror%2Ffrr.git lib,mgmtd,nhrpd: remove use of the EVENT_OFF macro Replace use of the deprecated macro with direct function call. Signed-off-by: Mark Stapp --- diff --git a/lib/bfd.c b/lib/bfd.c index 6300f6f5c0..4701842b3d 100644 --- a/lib/bfd.c +++ b/lib/bfd.c @@ -548,7 +548,7 @@ static void _bfd_sess_send(struct event *t) static void _bfd_sess_remove(struct bfd_session_params *bsp) { /* Cancel any pending installation request. */ - EVENT_OFF(bsp->installev); + event_cancel(&bsp->installev); /* Not installed, nothing to do. */ if (!bsp->installed) @@ -905,7 +905,7 @@ int zclient_bfd_session_replay(ZAPI_CALLBACK_ARGS) bsp->installed = false; /* Cancel any pending installation request. */ - EVENT_OFF(bsp->installev); + event_cancel(&bsp->installev); /* Ask for installation. */ bsp->lastev = BSE_INSTALL; diff --git a/lib/ldp_sync.c b/lib/ldp_sync.c index d55819dfaf..cb6605de43 100644 --- a/lib/ldp_sync.c +++ b/lib/ldp_sync.c @@ -66,7 +66,7 @@ bool ldp_sync_if_down(struct ldp_sync_info *ldp_sync_info) * update state */ if (ldp_sync_info && ldp_sync_info->enabled == LDP_IGP_SYNC_ENABLED) { - EVENT_OFF(ldp_sync_info->t_holddown); + event_cancel(&ldp_sync_info->t_holddown); if (ldp_sync_info->state == LDP_IGP_SYNC_STATE_REQUIRED_UP) ldp_sync_info->state = diff --git a/lib/mgmt_msg.c b/lib/mgmt_msg.c index aff9af7e84..97b46f6fec 100644 --- a/lib/mgmt_msg.c +++ b/lib/mgmt_msg.c @@ -641,9 +641,9 @@ void msg_conn_cleanup(struct msg_conn *conn) conn->fd = -1; } - EVENT_OFF(conn->read_ev); - EVENT_OFF(conn->write_ev); - EVENT_OFF(conn->proc_msg_ev); + event_cancel(&conn->read_ev); + event_cancel(&conn->write_ev); + event_cancel(&conn->proc_msg_ev); mgmt_msg_destroy(ms); } @@ -796,7 +796,7 @@ void msg_client_cleanup(struct msg_client *client) { assert(client->conn.is_client); - EVENT_OFF(client->conn_retry_tmr); + event_cancel(&client->conn_retry_tmr); free(client->sopath); msg_conn_cleanup(&client->conn); @@ -910,7 +910,7 @@ void msg_server_cleanup(struct msg_server *server) DEBUGD(server->debug, "Closing %s server", server->idtag); if (server->listen_ev) - EVENT_OFF(server->listen_ev); + event_cancel(&server->listen_ev); msg_server_list_del(&msg_servers, server); diff --git a/lib/northbound_notif.c b/lib/northbound_notif.c index 14da819375..76b4d7243e 100644 --- a/lib/northbound_notif.c +++ b/lib/northbound_notif.c @@ -735,7 +735,7 @@ void nb_notif_terminate(void) __dbg("terminating: timer: %p timer arg: %p walk %p", nb_notif_timer, args, nb_notif_walk); - EVENT_OFF(nb_notif_timer); + event_cancel(&nb_notif_timer); if (nb_notif_walk) { /* Grab walk args from walk if active. */ diff --git a/lib/northbound_oper.c b/lib/northbound_oper.c index 0ce9d77259..148185f739 100644 --- a/lib/northbound_oper.c +++ b/lib/northbound_oper.c @@ -183,7 +183,7 @@ static inline void nb_op_free_yield_state(struct nb_op_yield_state *ys, if (ys) { if (ys->user_tree && ys->user_tree_unlock) ys->user_tree_unlock(ys->user_tree, ys->user_tree_lock); - EVENT_OFF(ys->walk_ev); + event_cancel(&ys->walk_ev); nb_op_walks_del(&nb_op_walks, ys); /* if we have a branch then free up it's libyang tree */ if (!nofree_tree && ys_root_node(ys)) diff --git a/lib/northbound_sysrepo.c b/lib/northbound_sysrepo.c index 1f4d036cc2..84e99c8e91 100644 --- a/lib/northbound_sysrepo.c +++ b/lib/northbound_sysrepo.c @@ -625,7 +625,7 @@ static int frr_sr_finish(void) if (!module->sr_subscription) continue; sr_unsubscribe(module->sr_subscription); - EVENT_OFF(module->sr_thread); + event_cancel(&module->sr_thread); } if (session) diff --git a/lib/pullwr.c b/lib/pullwr.c index 919a663db5..598fadbb11 100644 --- a/lib/pullwr.c +++ b/lib/pullwr.c @@ -63,7 +63,7 @@ struct pullwr *_pullwr_new(struct event_loop *tm, int fd, void *arg, void pullwr_del(struct pullwr *pullwr) { - EVENT_OFF(pullwr->writer); + event_cancel(&pullwr->writer); XFREE(MTYPE_PULLWR_BUF, pullwr->buffer); XFREE(MTYPE_PULLWR_HEAD, pullwr); diff --git a/lib/resolver.c b/lib/resolver.c index 62b98091ec..46ac2e6630 100644 --- a/lib/resolver.c +++ b/lib/resolver.c @@ -116,7 +116,7 @@ static void resolver_cb_socket_readable(struct event *t) event_add_read(r->master, resolver_cb_socket_readable, resfd, resfd->fd, &resfd->t_read); /* ^ ordering important: - * ares_process_fd may transitively call EVENT_OFF(resfd->t_read) + * ares_process_fd may transitively call event_cancel(&resfd->t_read) * combined with resolver_fd_drop_maybe, so resfd may be free'd after! */ ares_process_fd(r->channel, resfd->fd, ARES_SOCKET_BAD); @@ -131,7 +131,7 @@ static void resolver_cb_socket_writable(struct event *t) event_add_write(r->master, resolver_cb_socket_writable, resfd, resfd->fd, &resfd->t_write); /* ^ ordering important: - * ares_process_fd may transitively call EVENT_OFF(resfd->t_write) + * ares_process_fd may transitively call event_cancel(&resfd->t_write) * combined with resolver_fd_drop_maybe, so resfd may be free'd after! */ ares_process_fd(r->channel, ARES_SOCKET_BAD, resfd->fd); @@ -142,7 +142,7 @@ static void resolver_update_timeouts(struct resolver_state *r) { struct timeval *tv, tvbuf; - EVENT_OFF(r->timeout); + event_cancel(&r->timeout); tv = ares_timeout(r->channel, NULL, &tvbuf); if (tv) { unsigned int timeoutms = tv->tv_sec * 1000 + tv->tv_usec / 1000; @@ -165,13 +165,13 @@ static void ares_socket_cb(void *data, ares_socket_t fd, int readable, assert(resfd->state == r); if (!readable) - EVENT_OFF(resfd->t_read); + event_cancel(&resfd->t_read); else if (!resfd->t_read) event_add_read(r->master, resolver_cb_socket_readable, resfd, fd, &resfd->t_read); if (!writable) - EVENT_OFF(resfd->t_write); + event_cancel(&resfd->t_write); else if (!resfd->t_write) event_add_write(r->master, resolver_cb_socket_writable, resfd, fd, &resfd->t_write); diff --git a/lib/spf_backoff.c b/lib/spf_backoff.c index b05c44ddf7..2c0d7de3c3 100644 --- a/lib/spf_backoff.c +++ b/lib/spf_backoff.c @@ -117,7 +117,7 @@ static void spf_backoff_holddown_elapsed(struct event *thread) { struct spf_backoff *backoff = EVENT_ARG(thread); - EVENT_OFF(backoff->t_timetolearn); + event_cancel(&backoff->t_timetolearn); timerclear(&backoff->first_event_time); backoff->state = SPF_BACKOFF_QUIET; backoff_debug("SPF Back-off(%s) HOLDDOWN elapsed, move to state %s", diff --git a/lib/vty.c b/lib/vty.c index 1d04e75bf4..c12f83ca13 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -1653,7 +1653,7 @@ static void vty_flush(struct event *thread) /* Tempolary disable read thread. */ if (vty->lines == 0) - EVENT_OFF(vty->t_read); + event_cancel(&vty->t_read); /* Function execution continue. */ erase = ((vty->status == VTY_MORE || vty->status == VTY_MORELINE)); @@ -1841,9 +1841,9 @@ void vty_stdio_suspend(void) if (!stdio_vty) return; - EVENT_OFF(stdio_vty->t_write); - EVENT_OFF(stdio_vty->t_read); - EVENT_OFF(stdio_vty->t_timeout); + event_cancel(&stdio_vty->t_write); + event_cancel(&stdio_vty->t_read); + event_cancel(&stdio_vty->t_timeout); if (stdio_termios) tcsetattr(0, TCSANOW, &stdio_orig_termios); @@ -2503,7 +2503,7 @@ void vty_serv_stop(void) struct vty_serv *vtyserv; while ((vtyserv = vtyservs_pop(vty_servs))) { - EVENT_OFF(vtyserv->t_accept); + event_cancel(&vtyserv->t_accept); close(vtyserv->sock); XFREE(MTYPE_VTY_SERV, vtyserv); } @@ -2549,9 +2549,9 @@ void vty_close(struct vty *vty) } /* Cancel threads.*/ - EVENT_OFF(vty->t_read); - EVENT_OFF(vty->t_write); - EVENT_OFF(vty->t_timeout); + event_cancel(&vty->t_read); + event_cancel(&vty->t_write); + event_cancel(&vty->t_timeout); if (vty->pass_fd != -1) { close(vty->pass_fd); @@ -3086,7 +3086,7 @@ static void vty_event(enum vty_event event, struct vty *vty) /* Time out treatment. */ if (vty->v_timeout) { - EVENT_OFF(vty->t_timeout); + event_cancel(&vty->t_timeout); event_add_timer(vty_master, vty_timeout, vty, vty->v_timeout, &vty->t_timeout); } @@ -3096,7 +3096,7 @@ static void vty_event(enum vty_event event, struct vty *vty) &vty->t_write); break; case VTY_TIMEOUT_RESET: - EVENT_OFF(vty->t_timeout); + event_cancel(&vty->t_timeout); if (vty->v_timeout) event_add_timer(vty_master, vty_timeout, vty, vty->v_timeout, &vty->t_timeout); diff --git a/lib/wheel.c b/lib/wheel.c index 3e90693b45..b0d7a5f95d 100644 --- a/lib/wheel.c +++ b/lib/wheel.c @@ -89,7 +89,7 @@ void wheel_delete(struct timer_wheel *wheel) list_delete(&wheel->wheel_slot_lists[i]); } - EVENT_OFF(wheel->timer); + event_cancel(&wheel->timer); XFREE(MTYPE_TIMER_WHEEL_LIST, wheel->wheel_slot_lists); XFREE(MTYPE_TIMER_WHEEL, wheel); } diff --git a/lib/workqueue.c b/lib/workqueue.c index d630af1d1d..9dac85c05b 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -96,7 +96,7 @@ void work_queue_free_and_null(struct work_queue **wqp) { struct work_queue *wq = *wqp; - EVENT_OFF(wq->thread); + event_cancel(&wq->thread); while (!work_queue_empty(wq)) { struct work_queue_item *item = work_queue_last_item(wq); @@ -213,7 +213,7 @@ void workqueue_cmd_init(void) */ void work_queue_plug(struct work_queue *wq) { - EVENT_OFF(wq->thread); + event_cancel(&wq->thread); UNSET_FLAG(wq->flags, WQ_UNPLUGGED); } diff --git a/lib/zclient.c b/lib/zclient.c index 7af86cf4d9..06e8b37a06 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -257,9 +257,9 @@ void zclient_stop(struct zclient *zclient) zlog_debug("zclient %p stopped", zclient); /* Stop threads. */ - EVENT_OFF(zclient->t_read); - EVENT_OFF(zclient->t_connect); - EVENT_OFF(zclient->t_write); + event_cancel(&zclient->t_read); + event_cancel(&zclient->t_connect); + event_cancel(&zclient->t_write); /* Reset streams. */ stream_reset(zclient->ibuf); @@ -393,7 +393,7 @@ enum zclient_send_status zclient_send_message(struct zclient *zclient) __func__, zclient->sock); return zclient_failed(zclient); case BUFFER_EMPTY: - EVENT_OFF(zclient->t_write); + event_cancel(&zclient->t_write); return ZCLIENT_SEND_SUCCESS; case BUFFER_PENDING: event_add_write(zclient->master, zclient_flush_data, zclient, diff --git a/mgmtd/mgmt_be_adapter.c b/mgmtd/mgmt_be_adapter.c index 8f70490379..f5bff0db9b 100644 --- a/mgmtd/mgmt_be_adapter.c +++ b/mgmtd/mgmt_be_adapter.c @@ -869,7 +869,7 @@ extern void mgmt_be_adapter_unlock(struct mgmt_be_client_adapter **adapter) if (!--a->refcount) { mgmt_be_adapters_del(&mgmt_be_adapters, a); - EVENT_OFF(a->conn_init_ev); + event_cancel(&a->conn_init_ev); msg_server_conn_delete(a->conn); XFREE(MTYPE_MGMTD_BE_ADPATER, a); } diff --git a/mgmtd/mgmt_testc.c b/mgmtd/mgmt_testc.c index ab8ea9a04d..c58b10bb20 100644 --- a/mgmtd/mgmt_testc.c +++ b/mgmtd/mgmt_testc.c @@ -157,7 +157,7 @@ static void sigusr1(void) static void quit(int exit_code) { - EVENT_OFF(event_timeout); + event_cancel(&event_timeout); darr_free(__client_cbs.notif_xpaths); darr_free(__client_cbs.rpc_xpaths); diff --git a/mgmtd/mgmt_txn.c b/mgmtd/mgmt_txn.c index 96ca62c847..459d08a4f9 100644 --- a/mgmtd/mgmt_txn.c +++ b/mgmtd/mgmt_txn.c @@ -757,7 +757,7 @@ static int mgmt_txn_send_commit_cfg_reply(struct mgmt_txn_ctx *txn, if (success) { /* Stop the commit-timeout timer */ /* XXX why only on success? */ - EVENT_OFF(txn->comm_cfg_timeout); + event_cancel(&txn->comm_cfg_timeout); create_cmt_info_rec = (result != MGMTD_NO_CFG_CHANGES && @@ -1299,7 +1299,7 @@ static int txn_get_tree_data_done(struct mgmt_txn_ctx *txn, int ret = NB_OK; /* cancel timer and send reply onward */ - EVENT_OFF(txn->get_tree_timeout); + event_cancel(&txn->get_tree_timeout); if (!get_tree->simple_xpath && get_tree->client_results) { /* @@ -1347,7 +1347,7 @@ static int txn_rpc_done(struct mgmt_txn_ctx *txn, struct mgmt_txn_req *txn_req) uint64_t req_id = txn_req->req_id; /* cancel timer and send reply onward */ - EVENT_OFF(txn->rpc_timeout); + event_cancel(&txn->rpc_timeout); if (rpc->errstr) mgmt_fe_adapter_txn_error(txn->txn_id, req_id, false, -EINVAL, @@ -1522,7 +1522,7 @@ static void mgmt_txn_process_commit_cfg(struct event *thread) * cleanup. Please see mgmt_fe_send_commit_cfg_reply() for * more details. */ - EVENT_OFF(txn->comm_cfg_timeout); + event_cancel(&txn->comm_cfg_timeout); mgmt_txn_send_commit_cfg_reply(txn, MGMTD_SUCCESS, NULL); break; case MGMTD_COMMIT_PHASE_MAX: @@ -1916,11 +1916,11 @@ static void mgmt_txn_unlock(struct mgmt_txn_ctx **txn, bool in_hash_free, const if ((*txn)->type == MGMTD_TXN_TYPE_CONFIG) if (mgmt_txn_mm->cfg_txn == *txn) mgmt_txn_mm->cfg_txn = NULL; - EVENT_OFF((*txn)->proc_get_cfg); - EVENT_OFF((*txn)->proc_get_data); - EVENT_OFF((*txn)->proc_comm_cfg); - EVENT_OFF((*txn)->comm_cfg_timeout); - EVENT_OFF((*txn)->get_tree_timeout); + event_cancel(&(*txn)->proc_get_cfg); + event_cancel(&(*txn)->proc_get_data); + event_cancel(&(*txn)->proc_comm_cfg); + event_cancel(&(*txn)->comm_cfg_timeout); + event_cancel(&(*txn)->get_tree_timeout); if (!in_hash_free) hash_release(mgmt_txn_mm->txn_hash, *txn); diff --git a/nhrpd/nhrp_cache.c b/nhrpd/nhrp_cache.c index e0b8f7bf88..b007dadd0a 100644 --- a/nhrpd/nhrp_cache.c +++ b/nhrpd/nhrp_cache.c @@ -74,8 +74,8 @@ static void nhrp_cache_free(struct nhrp_cache *c) nhrp_peer_notify_del(c->cur.peer, &c->peer_notifier); nhrp_peer_unref(c->cur.peer); nhrp_peer_unref(c->new.peer); - EVENT_OFF(c->t_timeout); - EVENT_OFF(c->t_auth); + event_cancel(&c->t_timeout); + event_cancel(&c->t_auth); XFREE(MTYPE_NHRP_CACHE, c); } @@ -312,7 +312,7 @@ static void nhrp_cache_peer_notifier(struct notifier_block *n, static void nhrp_cache_reset_new(struct nhrp_cache *c) { - EVENT_OFF(c->t_auth); + event_cancel(&c->t_auth); if (notifier_list_anywhere(&c->newpeer_notifier)) nhrp_peer_notify_del(c->new.peer, &c->newpeer_notifier); nhrp_peer_unref(c->new.peer); @@ -322,7 +322,7 @@ static void nhrp_cache_reset_new(struct nhrp_cache *c) static void nhrp_cache_update_timers(struct nhrp_cache *c) { - EVENT_OFF(c->t_timeout); + event_cancel(&c->t_timeout); switch (c->cur.type) { case NHRP_CACHE_INVALID: diff --git a/nhrpd/nhrp_event.c b/nhrpd/nhrp_event.c index ba318581d5..7259089fae 100644 --- a/nhrpd/nhrp_event.c +++ b/nhrpd/nhrp_event.c @@ -31,8 +31,8 @@ static void evmgr_reconnect(struct event *t); static void evmgr_connection_error(struct event_manager *evmgr) { - EVENT_OFF(evmgr->t_read); - EVENT_OFF(evmgr->t_write); + event_cancel(&evmgr->t_read); + event_cancel(&evmgr->t_write); zbuf_reset(&evmgr->ibuf); zbufq_reset(&evmgr->obuf); diff --git a/nhrpd/nhrp_multicast.c b/nhrpd/nhrp_multicast.c index aead982842..a80e2f30ab 100644 --- a/nhrpd/nhrp_multicast.c +++ b/nhrpd/nhrp_multicast.c @@ -194,7 +194,7 @@ static void netlink_mcast_log_register(int fd, int group) void netlink_mcast_set_nflog_group(int nlgroup) { if (netlink_mcast_log_fd >= 0) { - EVENT_OFF(netlink_mcast_log_thread); + event_cancel(&netlink_mcast_log_thread); close(netlink_mcast_log_fd); netlink_mcast_log_fd = -1; debugf(NHRP_DEBUG_COMMON, "De-register nflog group"); diff --git a/nhrpd/nhrp_nhs.c b/nhrpd/nhrp_nhs.c index b8958ba225..02b15ec447 100644 --- a/nhrpd/nhrp_nhs.c +++ b/nhrpd/nhrp_nhs.c @@ -88,7 +88,7 @@ static void nhrp_reg_reply(struct nhrp_reqid *reqid, void *arg) /* Success - schedule next registration, and route NHS */ r->timeout = 2; holdtime = nifp->afi[nhs->afi].holdtime; - EVENT_OFF(r->t_register); + event_cancel(&r->t_register); /* RFC 2332 5.2.3 - Registration is recommend to be renewed * every one third of holdtime */ @@ -148,7 +148,7 @@ static void nhrp_reg_peer_notify(struct notifier_block *n, unsigned long cmd) case NOTIFY_PEER_MTU_CHANGED: debugf(NHRP_DEBUG_COMMON, "NHS: Flush timer for %pSU", &r->peer->vc->remote.nbma); - EVENT_OFF(r->t_register); + event_cancel(&r->t_register); event_add_timer_msec(master, nhrp_reg_send_req, r, 10, &r->t_register); break; @@ -250,7 +250,7 @@ static void nhrp_reg_delete(struct nhrp_registration *r) nhrp_peer_notify_del(r->peer, &r->peer_notifier); nhrp_peer_unref(r->peer); nhrp_reglist_del(&r->nhs->reglist_head, r); - EVENT_OFF(r->t_register); + event_cancel(&r->t_register); XFREE(MTYPE_NHRP_REGISTRATION, r); } @@ -389,7 +389,7 @@ int nhrp_nhs_free(struct nhrp_interface *nifp, afi_t afi, struct nhrp_nhs *nhs) frr_each_safe (nhrp_reglist, &nhs->reglist_head, r) nhrp_reg_delete(r); - EVENT_OFF(nhs->t_resolve); + event_cancel(&nhs->t_resolve); nhrp_nhslist_del(&nifp->afi[afi].nhslist_head, nhs); free((void *)nhs->nbma_fqdn); XFREE(MTYPE_NHRP_NHS, nhs); diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c index 97932795a3..19d85d941c 100644 --- a/nhrpd/nhrp_peer.c +++ b/nhrpd/nhrp_peer.c @@ -43,8 +43,8 @@ static void nhrp_peer_check_delete(struct nhrp_peer *p) debugf(NHRP_DEBUG_COMMON, "Deleting peer ref:%d remote:%pSU local:%pSU", p->ref, &p->vc->remote.nbma, &p->vc->local.nbma); - EVENT_OFF(p->t_fallback); - EVENT_OFF(p->t_timer); + event_cancel(&p->t_fallback); + event_cancel(&p->t_timer); if (nifp->peer_hash) hash_release(nifp->peer_hash, p); nhrp_interface_notify_del(p->ifp, &p->ifp_notifier); @@ -77,7 +77,7 @@ static void __nhrp_peer_check(struct nhrp_peer *p) online = nifp->enabled && (!nifp->ipsec_profile || vc->ipsec); if (p->online != online) { - EVENT_OFF(p->t_fallback); + event_cancel(&p->t_fallback); if (online && notifier_active(&p->notifier_list)) { /* If we requested the IPsec connection, delay * the up notification a bit to allow things @@ -279,7 +279,7 @@ static void nhrp_peer_defer_vici_request(struct event *t) struct interface *ifp = p->ifp; struct nhrp_interface *nifp = ifp->info; - EVENT_OFF(p->t_timer); + event_cancel(&p->t_timer); if (p->online) { debugf(NHRP_DEBUG_COMMON, diff --git a/nhrpd/nhrp_shortcut.c b/nhrpd/nhrp_shortcut.c index 55d61a90b8..70995e41e4 100644 --- a/nhrpd/nhrp_shortcut.c +++ b/nhrpd/nhrp_shortcut.c @@ -126,7 +126,7 @@ static void nhrp_shortcut_update_binding(struct nhrp_shortcut *s, s->route_installed = 0; } - EVENT_OFF(s->t_shortcut_purge); + event_cancel(&s->t_shortcut_purge); if (holding_time) { s->expiring = 0; s->holding_time = holding_time; @@ -141,8 +141,8 @@ static void nhrp_shortcut_delete(struct nhrp_shortcut *s, struct route_node *rn; afi_t afi = family2afi(PREFIX_FAMILY(s->p)); - EVENT_OFF(s->t_shortcut_purge); - EVENT_OFF(s->t_retry_resolution); + event_cancel(&s->t_shortcut_purge); + event_cancel(&s->t_retry_resolution); nhrp_reqid_free(&nhrp_packet_reqid, &s->reqid); debugf(NHRP_DEBUG_ROUTE, "Shortcut %pFX purged", s->p); @@ -163,7 +163,7 @@ static void nhrp_shortcut_do_purge(struct event *t) { struct nhrp_shortcut *s = EVENT_ARG(t); s->t_shortcut_purge = NULL; - EVENT_OFF(s->t_retry_resolution); + event_cancel(&s->t_retry_resolution); nhrp_shortcut_delete(s, NULL); } @@ -210,8 +210,8 @@ static void nhrp_shortcut_recv_resolution_rep(struct nhrp_reqid *reqid, int holding_time = pp->if_ad->holdtime; nhrp_reqid_free(&nhrp_packet_reqid, &s->reqid); - EVENT_OFF(s->t_shortcut_purge); - EVENT_OFF(s->t_retry_resolution); + event_cancel(&s->t_shortcut_purge); + event_cancel(&s->t_retry_resolution); event_add_timer(master, nhrp_shortcut_do_purge, s, 1, &s->t_shortcut_purge); @@ -493,8 +493,8 @@ void nhrp_shortcut_initiate(union sockunion *addr) s = nhrp_shortcut_get(&p); if (s && s->type != NHRP_CACHE_INCOMPLETE) { s->addr = *addr; - EVENT_OFF(s->t_shortcut_purge); - EVENT_OFF(s->t_retry_resolution); + event_cancel(&s->t_shortcut_purge); + event_cancel(&s->t_retry_resolution); event_add_timer(master, nhrp_shortcut_do_purge, s, NHRPD_DEFAULT_PURGE_TIME, &s->t_shortcut_purge); @@ -506,7 +506,7 @@ static void nhrp_shortcut_retry_resolution_req(struct event *t) { struct nhrp_shortcut *s = EVENT_ARG(t); - EVENT_OFF(s->t_retry_resolution); + event_cancel(&s->t_retry_resolution); debugf(NHRP_DEBUG_COMMON, "Shortcut: Retrying Resolution Request"); nhrp_shortcut_send_resolution_req(s, true); } @@ -552,8 +552,8 @@ struct purge_ctx { void nhrp_shortcut_purge(struct nhrp_shortcut *s, int force) { - EVENT_OFF(s->t_shortcut_purge); - EVENT_OFF(s->t_retry_resolution); + event_cancel(&s->t_shortcut_purge); + event_cancel(&s->t_retry_resolution); nhrp_reqid_free(&nhrp_packet_reqid, &s->reqid); if (force) { diff --git a/nhrpd/vici.c b/nhrpd/vici.c index 8162ac06a6..3224bd9ec5 100644 --- a/nhrpd/vici.c +++ b/nhrpd/vici.c @@ -71,8 +71,8 @@ static void vici_connection_error(struct vici_conn *vici) { nhrp_vc_reset(); - EVENT_OFF(vici->t_read); - EVENT_OFF(vici->t_write); + event_cancel(&vici->t_read); + event_cancel(&vici->t_write); zbuf_reset(&vici->ibuf); zbufq_reset(&vici->obuf);