Revert "bgpd: When shutting down do not clear self peers"

This reverts commit 06480c0c81.

The original check aimed to skip iterating over the route table for
peers that were never established, addressing the issue described in
the link below.

With this change, any peer that is not BGP itself enters this condition
regardless of its establishment count, leading to a regression.

Link: https://github.com/FRRouting/frr/pull/16271
Signed-off-by: Loïc Sang <loic.sang@6wind.com>
This commit is contained in:
Loïc Sang 2025-04-25 15:50:47 +02:00
parent 217a90ee09
commit 5d21a3fbce

View file

@ -1267,7 +1267,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,