diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2024-09-12 16:11:52 +0200 | 
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2024-09-12 16:14:27 +0200 | 
| commit | 37702ca0802df6f8c7d2f2a81f85ca9cf6bdfdf4 (patch) | |
| tree | beb02624cf2a74d6e0619aa1bec4ea3c4ee2db9a /bgpd/bgp_fsm.c | |
| parent | 2b4a262c4512515e2138c04cca6d434afe1115dd (diff) | |
 bgpd: fix 'nexthop_set failed' error message often displayed
The 'nexthop_set failed, resetting connection - intf' log message
is often seen when peering with BGP peers. This message has been
displayed by introducing a recent fix that extracts the IP/port
information of outgoing connections when peering is not yet
established.
Fix this by separating the update of the socket information from
the call to bgp_zebra_nexthop_set().
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_fsm.c')
| -rw-r--r-- | bgpd/bgp_fsm.c | 20 | 
1 files changed, 8 insertions, 12 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 74ad65f1ec..cdd9b7ae4d 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1799,18 +1799,14 @@ bgp_connect_fail(struct peer_connection *connection)   */  static void bgp_connect_in_progress_update_connection(struct peer *peer)  { -	if (bgp_getsockname(peer) < 0) { -		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); -			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); -		} +	bgp_updatesockname(peer); +	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); +		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);  	}  }  | 
