summaryrefslogtreecommitdiff
path: root/bgpd/bgp_packet.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2025-04-01 10:20:44 -0400
committerGitHub <noreply@github.com>2025-04-01 10:20:44 -0400
commit161e2746b7b4503236738ae5b2a66eb8484d6dfb (patch)
treec0cddc7565edfa6fe961047e904780af16ec9dc9 /bgpd/bgp_packet.c
parentefa78f28ab0c156b76586bb427d49f5bdb600676 (diff)
parent20de25e281fa705aa7b13a953cfab9e6093e91a2 (diff)
Merge pull request #18517 from opensourcerouting/fix/backport_18498_10.1stable/10.1
bgpd: Retain the routes if we do a clear with N-bit set for Graceful-Restart (backport)
Diffstat (limited to 'bgpd/bgp_packet.c')
-rw-r--r--bgpd/bgp_packet.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index edef77b845..c3c21628bc 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -1031,6 +1031,13 @@ static void bgp_notify_send_internal(struct peer_connection *connection,
/* Add packet to peer's output queue */
stream_fifo_push(connection->obuf, s);
+ /* If Graceful-Restart N-bit (Notification) is exchanged,
+ * and it's not a Hard Reset, let's retain the routes.
+ */
+ if (bgp_has_graceful_restart_notification(peer) && !hard_reset &&
+ CHECK_FLAG(peer->sflags, PEER_STATUS_NSF_MODE))
+ SET_FLAG(peer->sflags, PEER_STATUS_NSF_WAIT);
+
bgp_peer_gr_flags_update(peer);
BGP_GR_ROUTER_DETECT_AND_SEND_CAPABILITY_TO_ZEBRA(peer->bgp,
peer->bgp->peer);