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>
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,