]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Set TCP_MD5 for outgoing connections when `password` is set
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 22 Mar 2023 13:17:30 +0000 (15:17 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 22 Mar 2023 13:55:38 +0000 (15:55 +0200)
If configuring `neighbor password` under VRF (not default), the session
will never be established.

Before setting TCP_MD5 for the connection fd, we need to enable this on the
accept direction as well (listener).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_network.c

index 6f035358f1c6e9c1a48de07f507e9dc33997a06d..3f9926151e2a3c8c59464b15ce5d906c57b0228b 100644 (file)
@@ -759,6 +759,9 @@ int bgp_connect(struct peer *peer)
                                             ? IPV4_MAX_BITLEN
                                             : IPV6_MAX_BITLEN;
 
+               if (!BGP_PEER_SU_UNSPEC(peer))
+                       bgp_md5_set(peer);
+
                bgp_md5_set_connect(peer->fd, &peer->su, prefixlen,
                                    peer->password);
        }