From 232470f3b7361b63d99f95796814ae81e1db34ab Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Fri, 15 Sep 2023 14:05:41 +0300 Subject: [PATCH] bgpd: Set TCP MSS for the socket even if the session is set to passive Signed-off-by: Donatas Abraitis --- bgpd/bgp_fsm.c | 6 ------ bgpd/bgp_network.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index a84ddae018..eef3b64408 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1832,12 +1832,6 @@ static enum bgp_fsm_state_progress bgp_start(struct peer_connection *connection) /* Clear peer capability flag. */ peer->cap = 0; - /* If the peer is passive mode, force to move to Active mode. */ - if (CHECK_FLAG(peer->flags, PEER_FLAG_PASSIVE)) { - BGP_EVENT_ADD(connection, TCP_connection_open_failed); - return BGP_FSM_SUCCESS; - } - if (peer->bgp->vrf_id == VRF_UNKNOWN) { if (bgp_debug_neighbor_events(peer)) flog_err( diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index 3e252a06f5..3bfdeb1771 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -782,6 +782,12 @@ int bgp_connect(struct peer_connection *connection) return connect_error; } + /* If the peer is passive mode, force to move to Active mode. */ + if (CHECK_FLAG(peer->flags, PEER_FLAG_PASSIVE)) { + BGP_EVENT_ADD(connection, TCP_connection_open_failed); + return BGP_FSM_SUCCESS; + } + if (peer->conf_if || peer->ifname) ifindex = ifname2ifindex(peer->conf_if ? peer->conf_if : peer->ifname, -- 2.39.5