]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Set TTL for iBGP/eBGP by checking only if Generic TTL security applied
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 10 Jun 2022 13:32:39 +0000 (16:32 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 10 Jun 2022 13:32:39 +0000 (16:32 +0300)
We set peer->ttl according if it's iBGP or eBGP, but when setting the TTL,
we technically ignore it.

Relax a bit and set TTL only if no GTSM configured.

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

index 77e2a0f53fc01010c747c821a4c3d06ac4a52ba0..bdd7ae04c2eb8be1c2d2e3ddde93a2f768404e55 100644 (file)
@@ -224,8 +224,7 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
 {
        int ret = 0;
 
-       /* In case of peer is EBGP, we should set TTL for this connection.  */
-       if (!peer->gtsm_hops && (peer_sort_lookup(peer) == BGP_PEER_EBGP)) {
+       if (!peer->gtsm_hops) {
                ret = sockopt_ttl(peer->su.sa.sa_family, bgp_sock, peer->ttl);
                if (ret) {
                        flog_err(
@@ -234,7 +233,7 @@ int bgp_set_socket_ttl(struct peer *peer, int bgp_sock)
                                __func__, &peer->remote_id, errno);
                        return ret;
                }
-       } else if (peer->gtsm_hops) {
+       } else {
                /* On Linux, setting minttl without setting ttl seems to mess
                   with the
                   outgoing ttl. Therefore setting both.