]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: align peer_unconfigure with gracefull-restart
authorDmytro Shytyi <dmytro.shytyi@6wind.com>
Mon, 10 Mar 2025 13:59:34 +0000 (14:59 +0100)
committerDmytro Shytyi <dmytro.shytyi@6wind.com>
Mon, 17 Mar 2025 10:19:58 +0000 (11:19 +0100)
When configured Graceful-Restart, skipping unconfig notification,
similarly as it is done in 95098d9611e79d43b578400bb76dc7a76aa8cab9
("bgpd: Do not send Deconfig/Shutdown message when restarting")

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
bgpd/bgpd.c

index 0f31719daf847f0e67b5aef0feac8534509fb88a..c95bf52ec3a9f4334d10f89750f2e50c317b37ad 100644 (file)
@@ -4202,8 +4202,15 @@ int bgp_delete(struct bgp *bgp)
                if (peer->ifp || CHECK_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE))
                        bgp_zebra_terminate_radv(peer->bgp, peer);
 
-               peer_notify_unconfig(peer->connection);
-               peer_delete(peer);
+               if (BGP_PEER_GRACEFUL_RESTART_CAPABLE(peer)) {
+                       if (bgp_debug_neighbor_events(peer))
+                               zlog_debug("%pBP configured Graceful-Restart, skipping unconfig notification",
+                                          peer);
+                       peer_delete(peer);
+               } else {
+                       peer_notify_unconfig(peer->connection);
+                       peer_delete(peer);
+               }
        }
 
        if (bgp->peer_self && !IS_BGP_INSTANCE_HIDDEN(bgp)) {