mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-25 11:28:06 +00:00
bgpd: bgp_connected_add memory was being leaked in some cases
On shutdown, bgp calls an unlock for the bnc connected table, via the bgp_connected_cleanup function. This function is only ever called on shutdown, so we know that bgp is going away. The refcount for the connected data can be more than 1. Let's not worry about the refcount on shutdown and just delete the nodes instead of leaving them around. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
c560f0698f
commit
1c225152c0
@ -500,11 +500,8 @@ static void bgp_connected_cleanup(struct route_table *table,
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
bc->refcnt--;
|
||||
if (bc->refcnt == 0) {
|
||||
XFREE(MTYPE_BGP_CONN, bc);
|
||||
bgp_dest_set_bgp_connected_ref_info(bn, NULL);
|
||||
}
|
||||
XFREE(MTYPE_BGP_CONN, bc);
|
||||
bgp_dest_set_bgp_connected_ref_info(bn, NULL);
|
||||
}
|
||||
|
||||
bool bgp_nexthop_self(struct bgp *bgp, afi_t afi, uint8_t type,
|
||||
|
Loading…
Reference in New Issue
Block a user