Commit 180e7b0abf for frr
commit 180e7b0abfbcbf0bc1d51e7c4e805dcc39e7e111
Author: Donald Sharp <sharpd@nvidia.com>
Date: Thu Oct 1 10:37:51 2026 -0400
bgpd: Respect the delay open value if sent when connection succeeds
The BGP rfc defines delay open as time to wait before sending a open
message after the connect succeeds. Currently in the bgp state
machine we have two paths for connect success:
a) Connect succeeds
b) Connect would block.
In the would block case, once it becomes ready, the delay open
value is respected and a timer is sent
In the Connect succeeds, the code goes straight to opening
the connection. Modify the code to do the exact same
thing for the (a) case that it does for the (b) case.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index deab53c442..6efd183599 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -2737,7 +2737,10 @@ static enum bgp_fsm_state_progress bgp_start(struct peer_connection *connection)
peer->host, connection->fd,
bgp_peer_get_connection_direction_string(connection));
- BGP_EVENT_ADD(connection, TCP_connection_open);
+ if (CHECK_FLAG(peer->flags, PEER_FLAG_TIMER_DELAYOPEN))
+ BGP_EVENT_ADD(connection, TCP_connection_open_w_delay);
+ else
+ BGP_EVENT_ADD(connection, TCP_connection_open);
break;
case connect_in_progress:
/* To check nonblocking connect, we wait until socket is