From 06480c0c81471d4e00aee669f78e426a083cb759 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 28 Mar 2025 14:54:37 -0400 Subject: [PATCH] bgpd: When shutting down do not clear self peers Commit: e0ae285eb8beeef7b43bdadc073d8ae346eaeb6c Modified the fsm state machine to attempt to not clear routes on a peer that was not established. The peer should be not a peer self. We do not want to ever clear the peer self. Signed-off-by: Donald Sharp --- bgpd/bgp_fsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 478f8c9136..940d93a8df 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1260,7 +1260,7 @@ void bgp_fsm_change_status(struct peer_connection *connection, /* Transition into Clearing or Deleted must /always/ clear all routes.. * (and must do so before actually changing into Deleted.. */ - if (status >= Clearing && (peer->established || peer == bgp->peer_self)) { + if (status >= Clearing && (peer->established || peer != bgp->peer_self)) { bgp_clear_route_all(peer); /* If no route was queued for the clear-node processing, -- 2.39.5