zebra: Unregister mpls hooks on zebra shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-11-20 13:52:01 -05:00
parent 82463eb1a9
commit 30c0efd68c
3 changed files with 15 additions and 4 deletions

View File

@ -231,6 +231,8 @@ void zebra_finalize(struct event *dummy)
zebra_rib_terminate(); zebra_rib_terminate();
zebra_router_terminate(); zebra_router_terminate();
zebra_mpls_terminate();
ns_terminate(); ns_terminate();
frr_fini(); frr_fini();
exit(0); exit(0);

View File

@ -4034,10 +4034,12 @@ void zebra_mpls_turned_on(void)
if (!mpls_enabled) { if (!mpls_enabled) {
mpls_processq_init(); mpls_processq_init();
mpls_enabled = true; mpls_enabled = true;
}
hook_register(zserv_client_close, zebra_mpls_cleanup_fecs_for_client); hook_register(zserv_client_close,
hook_register(zserv_client_close, zebra_mpls_cleanup_zclient_labels); zebra_mpls_cleanup_fecs_for_client);
hook_register(zserv_client_close,
zebra_mpls_cleanup_zclient_labels);
}
} }
/* /*
@ -4056,3 +4058,9 @@ void zebra_mpls_init(void)
zebra_mpls_turned_on(); zebra_mpls_turned_on();
} }
void zebra_mpls_terminate(void)
{
hook_unregister(zserv_client_close, zebra_mpls_cleanup_fecs_for_client);
hook_unregister(zserv_client_close, zebra_mpls_cleanup_zclient_labels);
}

View File

@ -400,9 +400,10 @@ void zebra_mpls_init_tables(struct zebra_vrf *zvrf);
void zebra_mpls_turned_on(void); void zebra_mpls_turned_on(void);
/* /*
* Global MPLS initialization. * Global MPLS initialization/termination.
*/ */
void zebra_mpls_init(void); void zebra_mpls_init(void);
void zebra_mpls_terminate(void);
/* /*
* MPLS VTY. * MPLS VTY.