mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-02 13:04:01 +00:00
Zebra: Cleanup registered nexthops upon client exit
Ensure registered nexthops are cleaned up when bgpd exits. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-9488 Reviewed By: CCR-4220 Testing Done: Manual testing
This commit is contained in:
parent
d1570739d9
commit
4b33b75a01
@ -1791,14 +1791,31 @@ zread_vrf_unregister (struct zserv *client, u_short length, vrf_id_t vrf_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Cleanup registered nexthops (across VRFs) upon client disconnect. */
|
||||
static void
|
||||
zebra_client_close_cleanup_rnh (struct zserv *client)
|
||||
{
|
||||
vrf_iter_t iter;
|
||||
struct zebra_vrf *zvrf;
|
||||
|
||||
for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
|
||||
{
|
||||
if ((zvrf = vrf_iter2info (iter)) != NULL)
|
||||
{
|
||||
zebra_cleanup_rnh_client(zvrf->vrf_id, AF_INET, client, RNH_NEXTHOP_TYPE);
|
||||
zebra_cleanup_rnh_client(zvrf->vrf_id, AF_INET6, client, RNH_NEXTHOP_TYPE);
|
||||
zebra_cleanup_rnh_client(zvrf->vrf_id, AF_INET, client, RNH_IMPORT_CHECK_TYPE);
|
||||
zebra_cleanup_rnh_client(zvrf->vrf_id, AF_INET6, client, RNH_IMPORT_CHECK_TYPE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Close zebra client. */
|
||||
static void
|
||||
zebra_client_close (struct zserv *client)
|
||||
{
|
||||
zebra_cleanup_rnh_client(0, AF_INET, client, RNH_NEXTHOP_TYPE);
|
||||
zebra_cleanup_rnh_client(0, AF_INET6, client, RNH_NEXTHOP_TYPE);
|
||||
zebra_cleanup_rnh_client(0, AF_INET, client, RNH_IMPORT_CHECK_TYPE);
|
||||
zebra_cleanup_rnh_client(0, AF_INET6, client, RNH_IMPORT_CHECK_TYPE);
|
||||
/* Cleanup any registered nexthops - across all VRFs. */
|
||||
zebra_client_close_cleanup_rnh (client);
|
||||
|
||||
/* Close file descriptor. */
|
||||
if (client->sock)
|
||||
|
Loading…
Reference in New Issue
Block a user