mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 03:47:47 +00:00
bgpd: Prevent memory leak of listener on shutdown
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
a0d46bcd08
commit
3f22218b48
14
bgpd/bgpd.c
14
bgpd/bgpd.c
@ -8228,18 +8228,20 @@ void bgp_terminate(void)
|
|||||||
* of a large number of peers this will ensure that no peer is left with
|
* of a large number of peers this will ensure that no peer is left with
|
||||||
* a dangling connection
|
* a dangling connection
|
||||||
*/
|
*/
|
||||||
/* reverse bgp_master_init */
|
|
||||||
bgp_close();
|
bgp_close();
|
||||||
|
/* reverse bgp_master_init */
|
||||||
if (bm->listen_sockets)
|
for (ALL_LIST_ELEMENTS(bm->bgp, mnode, mnnode, bgp)) {
|
||||||
list_delete(&bm->listen_sockets);
|
bgp_close_vrf_socket(bgp);
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS(bm->bgp, mnode, mnnode, bgp))
|
|
||||||
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer))
|
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer))
|
||||||
if (peer_established(peer) || peer->status == OpenSent
|
if (peer_established(peer) || peer->status == OpenSent
|
||||||
|| peer->status == OpenConfirm)
|
|| peer->status == OpenConfirm)
|
||||||
bgp_notify_send(peer, BGP_NOTIFY_CEASE,
|
bgp_notify_send(peer, BGP_NOTIFY_CEASE,
|
||||||
BGP_NOTIFY_CEASE_PEER_UNCONFIG);
|
BGP_NOTIFY_CEASE_PEER_UNCONFIG);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bm->listen_sockets)
|
||||||
|
list_delete(&bm->listen_sockets);
|
||||||
|
|
||||||
BGP_TIMER_OFF(bm->t_rmap_update);
|
BGP_TIMER_OFF(bm->t_rmap_update);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user