diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-06-26 15:34:03 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-06-27 10:47:50 +0200 |
commit | a5c9e190beb444f70c83579d0e3a7f77435a73fa (patch) | |
tree | 3904d75bdb932d61054da26899525b906dfdfc5f /ldpd | |
parent | pathd: Stop and free synchronous Zebra client on pathd termination (diff) | |
download | frr-a5c9e190beb444f70c83579d0e3a7f77435a73fa.tar.xz frr-a5c9e190beb444f70c83579d0e3a7f77435a73fa.zip |
ldpd: Stop and free synchronous Zebra client on destroy
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'ldpd')
-rw-r--r-- | ldpd/lde.c | 2 | ||||
-rw-r--r-- | ldpd/ldp_zebra.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ldpd/lde.c b/ldpd/lde.c index 806bab6a2..c7e915deb 100644 --- a/ldpd/lde.c +++ b/ldpd/lde.c @@ -87,7 +87,7 @@ static struct list *label_chunk_list; static struct listnode *current_label_chunk; /* Synchronous zclient to request labels */ -static struct zclient *zclient_sync; +struct zclient *zclient_sync; /* SIGINT / SIGTERM handler. */ static void diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c index 201082903..0fd5d4613 100644 --- a/ldpd/ldp_zebra.c +++ b/ldpd/ldp_zebra.c @@ -39,6 +39,7 @@ static int ldp_zebra_opaque_msg_handler(ZAPI_CALLBACK_ARGS); static void ldp_sync_zebra_init(void); static struct zclient *zclient; +extern struct zclient *zclient_sync; static bool zebra_registered = false; static void @@ -703,4 +704,10 @@ ldp_zebra_destroy(void) zclient_stop(zclient); zclient_free(zclient); zclient = NULL; + + if (zclient_sync == NULL) + return; + zclient_stop(zclient_sync); + zclient_free(zclient_sync); + zclient_sync = NULL; } |