summaryrefslogtreecommitdiffstats
path: root/bfdd
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 /bfdd
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 'bfdd')
-rw-r--r--bfdd/control.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/bfdd/control.c b/bfdd/control.c
index 3b954c64f..4929bf199 100644
--- a/bfdd/control.c
+++ b/bfdd/control.c
@@ -145,10 +145,7 @@ void control_shutdown(void)
{
struct bfd_control_socket *bcs;
- if (bglobal.bg_csockev) {
- thread_cancel(bglobal.bg_csockev);
- bglobal.bg_csockev = NULL;
- }
+ thread_cancel(&bglobal.bg_csockev);
socket_close(&bglobal.bg_csock);
@@ -204,15 +201,8 @@ static void control_free(struct bfd_control_socket *bcs)
struct bfd_control_queue *bcq;
struct bfd_notify_peer *bnp;
- if (bcs->bcs_ev) {
- thread_cancel(bcs->bcs_ev);
- bcs->bcs_ev = NULL;
- }
-
- if (bcs->bcs_outev) {
- thread_cancel(bcs->bcs_outev);
- bcs->bcs_outev = NULL;
- }
+ thread_cancel(&(bcs->bcs_ev));
+ thread_cancel(&(bcs->bcs_outev));
close(bcs->bcs_sd);
@@ -318,10 +308,7 @@ static int control_queue_dequeue(struct bfd_control_socket *bcs)
return 1;
empty_list:
- if (bcs->bcs_outev) {
- thread_cancel(bcs->bcs_outev);
- bcs->bcs_outev = NULL;
- }
+ thread_cancel(&(bcs->bcs_outev));
bcs->bcs_bout = NULL;
return 0;
}