summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_network.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:31 +0000
commitacb594b1d825c6e12369cebb941968ec08c840ce (patch)
treed544788908e7353a4f117e2991f15f4236a0c963 /bgpd/bgp_network.c
parentAdding upstream version 9.1. (diff)
downloadfrr-acb594b1d825c6e12369cebb941968ec08c840ce.tar.xz
frr-acb594b1d825c6e12369cebb941968ec08c840ce.zip
Adding upstream version 10.0.upstream/10.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bgpd/bgp_network.c')
-rw-r--r--bgpd/bgp_network.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index d831c6a..dbb34b0 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);
@@ -693,7 +706,6 @@ int bgp_update_address(struct interface *ifp, const union sockunion *dst,
{
struct prefix *p, *sel, d;
struct connected *connected;
- struct listnode *node;
int common;
if (!sockunion2hostprefix(dst, &d))
@@ -702,7 +714,7 @@ int bgp_update_address(struct interface *ifp, const union sockunion *dst,
sel = NULL;
common = -1;
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
+ frr_each (if_connected, ifp->connected, connected) {
p = connected->address;
if (p->family != d.family)
continue;