summaryrefslogtreecommitdiff
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2024-12-17 15:56:19 -0500
committerDonald Sharp <sharpd@nvidia.com>2025-01-10 10:07:11 -0500
commit78fa9b6feb0fc0fb0e9c3ff2db571c813e4b88ea (patch)
tree05542ed9d58e9304efbd10846f15930561dc069d /bgpd/bgp_fsm.c
parent0e416ff157341b69276e122a404837a22c890105 (diff)
bgpd: su_remote and su_local are properties of the connection
su_local and su_remote in the peer can change based upon if we are initiating the remote connection or receiving it. As such we need to treat it as a property of the connection. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 3389f9afd9..8097f5317d 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -1722,8 +1722,8 @@ bgp_connect_success(struct peer_connection *connection)
if (bgp_debug_neighbor_events(peer)) {
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER))
- zlog_debug("%s open active, local address %pSU",
- peer->host, peer->su_local);
+ zlog_debug("%s open active, local address %pSU", peer->host,
+ connection->su_local);
else
zlog_debug("%s passive open", peer->host);
}
@@ -1768,8 +1768,8 @@ bgp_connect_success_w_delayopen(struct peer_connection *connection)
if (bgp_debug_neighbor_events(peer)) {
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER))
- zlog_debug("%s open active, local address %pSU",
- peer->host, peer->su_local);
+ zlog_debug("%s open active, local address %pSU", peer->host,
+ connection->su_local);
else
zlog_debug("%s passive open", peer->host);
}
@@ -1820,13 +1820,13 @@ static void bgp_connect_in_progress_update_connection(struct peer_connection *co
struct peer *peer = connection->peer;
bgp_updatesockname(connection);
- if (!peer->su_remote && !BGP_CONNECTION_SU_UNSPEC(connection)) {
+ if (!connection->su_remote && !BGP_CONNECTION_SU_UNSPEC(connection)) {
/* if connect initiated, then dest port and dest addresses are well known */
- peer->su_remote = sockunion_dup(&connection->su);
- if (sockunion_family(peer->su_remote) == AF_INET)
- peer->su_remote->sin.sin_port = htons(peer->port);
- else if (sockunion_family(peer->su_remote) == AF_INET6)
- peer->su_remote->sin6.sin6_port = htons(peer->port);
+ connection->su_remote = sockunion_dup(&connection->su);
+ if (sockunion_family(connection->su_remote) == AF_INET)
+ connection->su_remote->sin.sin_port = htons(peer->port);
+ else if (sockunion_family(connection->su_remote) == AF_INET6)
+ connection->su_remote->sin6.sin6_port = htons(peer->port);
}
}