]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Set TCP MSS for the socket even if the session is set to passive
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 15 Sep 2023 11:05:41 +0000 (14:05 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 18 Sep 2023 12:42:06 +0000 (15:42 +0300)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_fsm.c
bgpd/bgp_network.c

index a84ddae0184b2ba867bb3ee578464a1d4d7d0c4b..eef3b644080a4315b91db4f512c8d48fc5ac5c89 100644 (file)
@@ -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(
index 3e252a06f594262604ef05ce3d26f59dcbc13e94..3bfdeb17710ac6ccdc9fa53b816e8a83776c710e 100644 (file)
@@ -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,