From: Donald Sharp Date: Fri, 28 Mar 2025 18:54:37 +0000 (-0400) Subject: bgpd: When shutting down do not clear self peers X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=06480c0c81471d4e00aee669f78e426a083cb759;p=mirror%2Ffrr.git 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 --- 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,