Browse Source

bgpd: Alow gracefull shutdown of peers

Send CEASE NOTIFICATIONS to all peers on "no router bgp"

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Daniel Walton 4 years ago
parent
commit
9e518dd52b
1 changed files with 11 additions and 0 deletions
  1. 11 0
      bgpd/bgpd.c

+ 11 - 0
bgpd/bgpd.c

@@ -2210,6 +2210,17 @@ bgp_delete (struct bgp *bgp)
 
   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);