bgpd: align peer_unconfigure with gracefull-restart

When configured Graceful-Restart, skipping unconfig notification,
similarly as it is done in 95098d9611
("bgpd: Do not send Deconfig/Shutdown message when restarting")

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
This commit is contained in:
Dmytro Shytyi 2025-03-10 14:59:34 +01:00
parent 496caed836
commit 942a7c916c
No known key found for this signature in database
GPG key ID: 718B775A0DC16C29

View file

@ -4202,8 +4202,15 @@ int bgp_delete(struct bgp *bgp)
if (peer->ifp || CHECK_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE))
bgp_zebra_terminate_radv(peer->bgp, peer);
peer_notify_unconfig(peer->connection);
peer_delete(peer);
if (BGP_PEER_GRACEFUL_RESTART_CAPABLE(peer)) {
if (bgp_debug_neighbor_events(peer))
zlog_debug("%pBP configured Graceful-Restart, skipping unconfig notification",
peer);
peer_delete(peer);
} else {
peer_notify_unconfig(peer->connection);
peer_delete(peer);
}
}
if (bgp->peer_self && !IS_BGP_INSTANCE_HIDDEN(bgp)) {