]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Unregister mpls hooks on zebra shutdown
authorDonald Sharp <sharpd@nvidia.com>
Mon, 20 Nov 2023 18:52:01 +0000 (13:52 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 21 Nov 2023 17:41:18 +0000 (12:41 -0500)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/main.c
zebra/zebra_mpls.c
zebra/zebra_mpls.h

index 304f4797fcf49055808846122c49529817d5a97b..59bad8f355d9784eb7be4ab10f37aaadd607efc0 100644 (file)
@@ -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);
index 7fca3654685017125f63297e9e3ddd30d3a22a89..e42c28985afb3357837f61073210d9c8ac5c4e4b 100644 (file)
@@ -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);
+}
index 7feace56b55d2c1a9a1a51418a19975cdacb0714..1ed2f9b41c5b571b406d21dbae997a35e6e779ee 100644 (file)
@@ -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.