]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib,mgmtd,nhrpd: remove use of the EVENT_OFF macro
authorMark Stapp <mjs@cisco.com>
Tue, 29 Apr 2025 18:26:25 +0000 (14:26 -0400)
committerMark Stapp <mjs@cisco.com>
Tue, 29 Apr 2025 18:45:29 +0000 (14:45 -0400)
Replace use of the deprecated macro with direct function call.

Signed-off-by: Mark Stapp <mjs@cisco.com>
23 files changed:
lib/bfd.c
lib/ldp_sync.c
lib/mgmt_msg.c
lib/northbound_notif.c
lib/northbound_oper.c
lib/northbound_sysrepo.c
lib/pullwr.c
lib/resolver.c
lib/spf_backoff.c
lib/vty.c
lib/wheel.c
lib/workqueue.c
lib/zclient.c
mgmtd/mgmt_be_adapter.c
mgmtd/mgmt_testc.c
mgmtd/mgmt_txn.c
nhrpd/nhrp_cache.c
nhrpd/nhrp_event.c
nhrpd/nhrp_multicast.c
nhrpd/nhrp_nhs.c
nhrpd/nhrp_peer.c
nhrpd/nhrp_shortcut.c
nhrpd/vici.c

index 6300f6f5c03643fbe85806b34ccdb9d8ef0b07b4..4701842b3da8407a019c5531f2250d9fd480cfb7 100644 (file)
--- 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;
index d55819dfaffa6d112fb6b257528069c675d697b9..cb6605de434e1ea740fc45182b094bcac7ae418a 100644 (file)
@@ -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 =
index aff9af7e8460a37058a2ff197f03a3f458185434..97b46f6fec0bd58f2644a65600502c0bf522c023 100644 (file)
@@ -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);
 
index 14da819375d09261d5427d4bf8d6d29edb47ecf7..76b4d7243e15b079c2bce027e61149d8fb011e03 100644 (file)
@@ -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. */
index 0ce9d77259e63192f9d16536db04a4f2530b0433..148185f739ab0c015569d67202b4a7d292d92255 100644 (file)
@@ -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))
index 1f4d036cc23fcf19b3347db4cf6b1b15accacdeb..84e99c8e91f49a6970f562553a0c9c49d2e71692 100644 (file)
@@ -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)
index 919a663db5366a38d6e0cc5704f9bf20df29b758..598fadbb119503f0f0b3460e355080abac9a1d9e 100644 (file)
@@ -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);
index 62b98091ec4673647c8a707751f0faea513330a7..46ac2e66305134e61fb3f730389dbbbb9955e585 100644 (file)
@@ -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);
index b05c44ddf7356315c81701f5a9f1789161877d1d..2c0d7de3c3f9e4bc9d4dd1360115e1123519341d 100644 (file)
@@ -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",
index 1d04e75bf445bab475d426870ae4a034319d599f..c12f83ca136791bd27ea5c2c118e9eeee2f8ab0d 100644 (file)
--- 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);
index 3e90693b455b5fdc78c2d06997ece21cd2bdc1c4..b0d7a5f95d78b58e873d22461b988414059794e5 100644 (file)
@@ -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);
 }
index d630af1d1db0bbee8228921246917d82e2690a07..9dac85c05b3d182fdc423fa19bc4d99349a7f4da 100644 (file)
@@ -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);
 }
index 7af86cf4d99a14cc7aff7b87001957383687c547..06e8b37a06ff2e402c4b6fa1521ee6a9d5341e97 100644 (file)
@@ -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,
index 8f7049037967944fab0ff0ada2324f78245f7fc7..f5bff0db9ba7f7df49c829c2c4893ea8bef66c68 100644 (file)
@@ -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);
        }
index ab8ea9a04d70c88c1aff42231c7f1d43fe6cba44..c58b10bb20bddc346df54f2c2c96a76dd088b7be 100644 (file)
@@ -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);
 
index 96ca62c847fa1e404dc8fd5f65d5564831e6f36e..459d08a4f9649d813e6cade3191b1d37b12681a6 100644 (file)
@@ -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);
 
index e0b8f7bf8888d0878fb610319846a3da2d99f2ad..b007dadd0ad20735c3007810e44931f01efb5909 100644 (file)
@@ -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:
index ba318581d572d721117be31a6b24987bac0e2176..7259089faeb523a05825d958ab31285041a22ba0 100644 (file)
@@ -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);
 
index aead982842a177451cc493db81b77802c47730f4..a80e2f30ab1c197ef8d48f3150a271074b164058 100644 (file)
@@ -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");
index b8958ba22595e07e081392cc95c7244271f36265..02b15ec447bbaaa76bac9025db85da5db28495bc 100644 (file)
@@ -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);
index 97932795a3f8d732a1172f0a5cfd7d4a3a83cfc8..19d85d941cf033b267293ae6c18ad1634baad551 100644 (file)
@@ -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,
index 55d61a90b8dddfa6f416734619487f7603adbba5..70995e41e4b8ac74f8afa3503e3763aa2fc55747 100644 (file)
@@ -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) {
index 8162ac06a6e4ca02e16f15bd4e276252ec281da9..3224bd9ec588076152dd74813733e2326fabbb59 100644 (file)
@@ -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);