bgpd: Alow gracefull shutdown of peers
Send CEASE NOTIFICATIONS to all peers on "no router bgp"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 7f472c5..669782d 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -2210,6 +2210,17 @@
THREAD_OFF (bgp->t_startup);
+ for (ALL_LIST_ELEMENTS (bgp->peer, node, next, peer))
+ {
+ if (peer->status == Established ||
+ peer->status == OpenSent ||
+ peer->status == OpenConfirm)
+ {
+ bgp_notify_send (peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_PEER_UNCONFIG);
+ }
+ }
+
/* Delete static route. */
bgp_static_delete (bgp);