diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-01-12 19:26:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-12 19:26:34 +0100 |
commit | 945318802e9290cb8074c965ddfb23fcb9c6d50b (patch) | |
tree | c960164929aae91fd21e7886d1ef1e07f9aa852c /bgpd | |
parent | Merge pull request #15130 from donaldsharp/pim_vxlan_issues (diff) | |
parent | bgpd: Set correct TTL for the dynamic neighbor peers (diff) | |
download | frr-945318802e9290cb8074c965ddfb23fcb9c6d50b.tar.xz frr-945318802e9290cb8074c965ddfb23fcb9c6d50b.zip |
Merge pull request #15121 from routingrocks/rajesh/bgp_peer_ttl
bgpd: Set correct TTL for the dynamic neighbor peers
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_network.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index e07b18f8f..dbb34b048 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -484,10 +484,23 @@ static void bgp_accept(struct event *thread) /* Dynamic neighbor has been created, let it proceed */ connection1->fd = bgp_sock; + if (bgp_set_socket_ttl(connection1) < 0) { + peer1->last_reset = PEER_DOWN_SOCKET_ERROR; + zlog_err("%s: Unable to set min/max TTL on peer %s (dynamic), error received: %s(%d)", + __func__, peer1->host, + safe_strerror(errno), errno); + return; + } + /* Set the user configured MSS to TCP socket */ if (CHECK_FLAG(peer1->flags, PEER_FLAG_TCP_MSS)) sockopt_tcp_mss_set(bgp_sock, peer1->tcp_mss); + frr_with_privs (&bgpd_privs) { + vrf_bind(peer1->bgp->vrf_id, bgp_sock, + bgp_get_bound_name(connection1)); + } + bgp_peer_reg_with_nht(peer1); bgp_fsm_change_status(connection1, Active); EVENT_OFF(connection1->t_start); |