summaryrefslogtreecommitdiffstats
path: root/babeld
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-07-06 18:55:03 +0200
committerMark Stapp <mjs@voltanet.io>2020-10-23 14:59:34 +0200
commitb3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9 (patch)
treeb5ef6dcab41d9da516a6ff044056e0faca7b35da /babeld
parentMerge pull request #7345 from opensourcerouting/bgp-aggr-suppress (diff)
downloadfrr-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 'babeld')
-rw-r--r--babeld/babeld.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 09955cfbe..895ede704 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -317,13 +317,9 @@ babel_clean_routing_process(void)
flush_all_routes();
babel_interface_close_all();
- /* cancel threads */
- if (babel_routing_process->t_read != NULL) {
- thread_cancel(babel_routing_process->t_read);
- }
- if (babel_routing_process->t_update != NULL) {
- thread_cancel(babel_routing_process->t_update);
- }
+ /* cancel events */
+ thread_cancel(&babel_routing_process->t_read);
+ thread_cancel(&babel_routing_process->t_update);
distribute_list_delete(&babel_routing_process->distribute_ctx);
XFREE(MTYPE_BABEL, babel_routing_process);
@@ -503,9 +499,7 @@ static void
babel_set_timer(struct timeval *timeout)
{
long msecs = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
- if (babel_routing_process->t_update != NULL) {
- thread_cancel(babel_routing_process->t_update);
- }
+ thread_cancel(&(babel_routing_process->t_update));
thread_add_timer_msec(master, babel_main_loop, NULL, msecs, &babel_routing_process->t_update);
}