Skip to content

Commit

Permalink
bgpd: Modify bgp_connect_in_progress_update_connection to use connection
Browse files Browse the repository at this point in the history
Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Nov 7, 2024
1 parent 30d5d1d commit 3cd9351
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bgpd/bgp_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1808,12 +1808,14 @@ bgp_connect_fail(struct peer_connection *connection)
/* after connect is called(), getpeername is able to return
* port and address on non established streams
*/
static void bgp_connect_in_progress_update_connection(struct peer *peer)
static void bgp_connect_in_progress_update_connection(struct peer_connection *connection)
{
bgp_updatesockname(peer, peer->connection);
struct peer *peer = connection->peer;

bgp_updatesockname(peer, connection);
if (!peer->su_remote && !BGP_CONNECTION_SU_UNSPEC(peer->connection)) {
/* if connect initiated, then dest port and dest addresses are well known */
peer->su_remote = sockunion_dup(&peer->connection->su);
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)
Expand Down Expand Up @@ -1917,7 +1919,7 @@ static enum bgp_fsm_state_progress bgp_start(struct peer_connection *connection)
__func__, peer->connection->fd);
return BGP_FSM_FAILURE;
}
bgp_connect_in_progress_update_connection(peer);
bgp_connect_in_progress_update_connection(connection);

/*
* - when the socket becomes ready, poll() will signify POLLOUT
Expand Down

0 comments on commit 3cd9351

Please sign in to comment.