diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-11-20 13:52:01 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-11-21 12:41:18 -0500 |
| commit | 30c0efd68c9ce1f94b1696e19e76ba4e4765d09a (patch) | |
| tree | fbdc0b67a315786c1eb353680996ce3ef3889f35 | |
| parent | 82463eb1a927bcbc398765e29f76cd4d5f0c005d (diff) | |
zebra: Unregister mpls hooks on zebra shutdown
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| -rw-r--r-- | zebra/main.c | 2 | ||||
| -rw-r--r-- | zebra/zebra_mpls.c | 14 | ||||
| -rw-r--r-- | zebra/zebra_mpls.h | 3 |
3 files changed, 15 insertions, 4 deletions
diff --git a/zebra/main.c b/zebra/main.c index 304f4797fc..59bad8f355 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -231,6 +231,8 @@ void zebra_finalize(struct event *dummy) zebra_rib_terminate(); zebra_router_terminate(); + zebra_mpls_terminate(); + ns_terminate(); frr_fini(); exit(0); diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 7fca365468..e42c28985a 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -4034,10 +4034,12 @@ void zebra_mpls_turned_on(void) if (!mpls_enabled) { mpls_processq_init(); mpls_enabled = true; - } - hook_register(zserv_client_close, zebra_mpls_cleanup_fecs_for_client); - hook_register(zserv_client_close, zebra_mpls_cleanup_zclient_labels); + hook_register(zserv_client_close, + 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(); } + +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); +} diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index 7feace56b5..1ed2f9b41c 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -400,9 +400,10 @@ void zebra_mpls_init_tables(struct zebra_vrf *zvrf); void zebra_mpls_turned_on(void); /* - * Global MPLS initialization. + * Global MPLS initialization/termination. */ void zebra_mpls_init(void); +void zebra_mpls_terminate(void); /* * MPLS VTY. |
