summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldpd/lde.c2
-rw-r--r--ldpd/ldp_zebra.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/ldpd/lde.c b/ldpd/lde.c
index 806bab6a21..c7e915deb3 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 2010829035..0fd5d4613c 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;
}