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>
This commit is contained in:
Donald Sharp 2023-11-11 20:13:00 -05:00
parent 5dcd9f65e3
commit 0e44d248a0
3 changed files with 13 additions and 0 deletions

View file

@ -71,6 +71,8 @@ static void sigint(void)
pbr_vrf_terminate(); pbr_vrf_terminate();
pbr_zebra_destroy();
frr_fini(); frr_fini();
exit(0); exit(0);

View file

@ -419,6 +419,16 @@ void pbr_zebra_init(void)
zclient->zebra_connected = zebra_connected; 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) void pbr_send_rnh(struct nexthop *nhop, bool reg)
{ {
uint32_t command; uint32_t command;

View file

@ -14,6 +14,7 @@ struct pbr_interface {
extern struct event_loop *master; extern struct event_loop *master;
extern void pbr_zebra_init(void); extern void pbr_zebra_init(void);
extern void pbr_zebra_destroy(void);
extern void route_add(struct pbr_nexthop_group_cache *pnhgc, extern void route_add(struct pbr_nexthop_group_cache *pnhgc,
struct nexthop_group nhg, afi_t install_afi); struct nexthop_group nhg, afi_t install_afi);