diff options
author | Mark Stapp <mjs@voltanet.io> | 2020-07-06 18:55:03 +0200 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2020-10-23 14:59:34 +0200 |
commit | b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9 (patch) | |
tree | b5ef6dcab41d9da516a6ff044056e0faca7b35da /isisd | |
parent | Merge pull request #7345 from opensourcerouting/bgp-aggr-suppress (diff) | |
download | frr-b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9.tar.xz frr-b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9.zip |
* : update signature of thread_cancel api
Change thread_cancel to take a ** to an event, NULL-check
before dereferencing, and NULL the caller's pointer. Update
many callers to use the new signature.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/fabricd.c | 27 | ||||
-rw-r--r-- | isisd/isis_pdu.c | 2 | ||||
-rw-r--r-- | isisd/isis_tx_queue.c | 9 |
3 files changed, 12 insertions, 26 deletions
diff --git a/isisd/fabricd.c b/isisd/fabricd.c index 1a081bbea..57e9e91c1 100644 --- a/isisd/fabricd.c +++ b/isisd/fabricd.c @@ -239,14 +239,11 @@ struct fabricd *fabricd_new(struct isis_area *area) void fabricd_finish(struct fabricd *f) { - if (f->initial_sync_timeout) - thread_cancel(f->initial_sync_timeout); + thread_cancel(&(f->initial_sync_timeout)); - if (f->tier_calculation_timer) - thread_cancel(f->tier_calculation_timer); + thread_cancel(&(f->tier_calculation_timer)); - if (f->tier_set_timer) - thread_cancel(f->tier_set_timer); + thread_cancel(&(f->tier_set_timer)); isis_spftree_del(f->spftree); neighbor_lists_clear(f); @@ -340,8 +337,7 @@ void fabricd_initial_sync_finish(struct isis_area *area) f->initial_sync_circuit->interface->name); f->initial_sync_state = FABRICD_SYNC_COMPLETE; f->initial_sync_circuit = NULL; - thread_cancel(f->initial_sync_timeout); - f->initial_sync_timeout = NULL; + thread_cancel(&(f->initial_sync_timeout)); } static void fabricd_bump_tier_calculation_timer(struct fabricd *f); @@ -437,22 +433,15 @@ static int fabricd_tier_calculation_cb(struct thread *thread) static void fabricd_bump_tier_calculation_timer(struct fabricd *f) { /* Cancel timer if we already know our tier */ - if (f->tier != ISIS_TIER_UNDEFINED - || f->tier_set_timer) { - if (f->tier_calculation_timer) { - thread_cancel(f->tier_calculation_timer); - f->tier_calculation_timer = NULL; - } + if (f->tier != ISIS_TIER_UNDEFINED || f->tier_set_timer) { + thread_cancel(&(f->tier_calculation_timer)); return; } /* If we need to calculate the tier, wait some * time for the topology to settle before running * the calculation */ - if (f->tier_calculation_timer) { - thread_cancel(f->tier_calculation_timer); - f->tier_calculation_timer = NULL; - } + thread_cancel(&(f->tier_calculation_timer)); thread_add_timer(master, fabricd_tier_calculation_cb, f, 2 * f->area->lsp_gen_interval[ISIS_LEVEL2 - 1], @@ -737,7 +726,7 @@ void fabricd_trigger_csnp(struct isis_area *area, bool circuit_scoped) if (!circuit->t_send_csnp[1]) continue; - thread_cancel(circuit->t_send_csnp[ISIS_LEVEL2 - 1]); + thread_cancel(&(circuit->t_send_csnp[ISIS_LEVEL2 - 1])); thread_add_timer_msec(master, send_l2_csnp, circuit, isis_jitter(f->csnp_delay, CSNP_JITTER), &circuit->t_send_csnp[ISIS_LEVEL2 - 1]); diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index d6f257117..63be8841c 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -1987,7 +1987,7 @@ static void _send_hello_sched(struct isis_circuit *circuit, if (thread_timer_remain_msec(*threadp) < (unsigned long)delay) return; - thread_cancel(*threadp); + thread_cancel(threadp); } thread_add_timer_msec(master, send_hello_cb, diff --git a/isisd/isis_tx_queue.c b/isisd/isis_tx_queue.c index 1424b55bd..5c87e3915 100644 --- a/isisd/isis_tx_queue.c +++ b/isisd/isis_tx_queue.c @@ -93,8 +93,7 @@ static void tx_queue_element_free(void *element) { struct isis_tx_queue_entry *e = element; - if (e->retry) - thread_cancel(e->retry); + thread_cancel(&(e->retry)); XFREE(MTYPE_TX_QUEUE_ENTRY, e); } @@ -166,8 +165,7 @@ void _isis_tx_queue_add(struct isis_tx_queue *queue, e->type = type; - if (e->retry) - thread_cancel(e->retry); + thread_cancel(&(e->retry)); thread_add_event(master, tx_queue_send_event, e, 0, &e->retry); e->is_retry = false; @@ -190,8 +188,7 @@ void _isis_tx_queue_del(struct isis_tx_queue *queue, struct isis_lsp *lsp, func, file, line); } - if (e->retry) - thread_cancel(e->retry); + thread_cancel(&(e->retry)); hash_release(queue->hash, e); XFREE(MTYPE_TX_QUEUE_ENTRY, e); |