forked from Mirror/frr
Merge pull request #13847 from opensourcerouting/fix/free_zclient_sync_on_destroy
Stop and free synchronous Zebra client on destroy
This commit is contained in:
commit
1f322e4cef
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ DEFINE_MTYPE_STATIC(OSPFD, OSPF_REDISTRIBUTE, "OSPF Redistriute");
|
|||
/* Zebra structure to hold current status. */
|
||||
struct zclient *zclient = NULL;
|
||||
/* and for the Synchronous connection to the Label Manager */
|
||||
static struct zclient *zclient_sync;
|
||||
struct zclient *zclient_sync;
|
||||
|
||||
/* For registering threads. */
|
||||
extern struct event_loop *master;
|
||||
|
|
|
@ -60,6 +60,7 @@ struct ospf_master *om;
|
|||
unsigned short ospf_instance;
|
||||
|
||||
extern struct zclient *zclient;
|
||||
extern struct zclient *zclient_sync;
|
||||
|
||||
/* OSPF config processing timer thread */
|
||||
struct event *t_ospf_cfg;
|
||||
|
@ -683,6 +684,8 @@ void ospf_terminate(void)
|
|||
*/
|
||||
zclient_stop(zclient);
|
||||
zclient_free(zclient);
|
||||
zclient_stop(zclient_sync);
|
||||
zclient_free(zclient_sync);
|
||||
|
||||
done:
|
||||
frr_fini();
|
||||
|
|
|
@ -344,4 +344,6 @@ void path_zebra_stop(void)
|
|||
{
|
||||
zclient_stop(zclient);
|
||||
zclient_free(zclient);
|
||||
zclient_stop(zclient_sync);
|
||||
zclient_free(zclient_sync);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue