summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-11-12 02:13:00 +0100
committerDonald Sharp <sharpd@nvidia.com>2023-11-13 15:15:43 +0100
commit0e44d248a048cefa646a89fe07aa3607739b0c74 (patch)
treea09539ba538e125aa8442ef3986f361c5afcc050 /pbrd
parentMerge pull request #14772 from LabNConsulting/fix-darr-memory-acct (diff)
downloadfrr-0e44d248a048cefa646a89fe07aa3607739b0c74.tar.xz
frr-0e44d248a048cefa646a89fe07aa3607739b0c74.zip
pbrd: Cleanup zclient on shutdown
For some reason pbrd had no shutdown code for zclient. Now it does. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_main.c2
-rw-r--r--pbrd/pbr_zebra.c10
-rw-r--r--pbrd/pbr_zebra.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/pbrd/pbr_main.c b/pbrd/pbr_main.c
index 6699079a6..dd4893bb7 100644
--- a/pbrd/pbr_main.c
+++ b/pbrd/pbr_main.c
@@ -71,6 +71,8 @@ static void sigint(void)
pbr_vrf_terminate();
+ pbr_zebra_destroy();
+
frr_fini();
exit(0);
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index 30eaf6290..d47a308ac 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -419,6 +419,16 @@ void pbr_zebra_init(void)
zclient->zebra_connected = zebra_connected;
}
+void pbr_zebra_destroy(void)
+{
+ if (zclient == NULL)
+ return;
+
+ zclient_stop(zclient);
+ zclient_free(zclient);
+ zclient = NULL;
+}
+
void pbr_send_rnh(struct nexthop *nhop, bool reg)
{
uint32_t command;
diff --git a/pbrd/pbr_zebra.h b/pbrd/pbr_zebra.h
index ef844ef79..5cbb1fd68 100644
--- a/pbrd/pbr_zebra.h
+++ b/pbrd/pbr_zebra.h
@@ -14,6 +14,7 @@ struct pbr_interface {
extern struct event_loop *master;
extern void pbr_zebra_init(void);
+extern void pbr_zebra_destroy(void);
extern void route_add(struct pbr_nexthop_group_cache *pnhgc,
struct nexthop_group nhg, afi_t install_afi);