Skip to content

Commit

Permalink
bgpd: fill in bgp connection info whenever available
Browse files Browse the repository at this point in the history
When attempting to establish a BGP peering, be it passive or not,
once TCP SYN, or SYN ACK is received, BGP attempts to get addressing
information. If local addressing fails, remote addressing is not
looked up.

Fix this by relaxing the error code for local addressing, and attempt
to call remote addressing.

Fixes: 1ff9a34 ("bgpd: bgpd-fsm-fix.patch")

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Apr 5, 2024
1 parent d0b1b2f commit a6cee29
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bgpd/bgp_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,9 @@ int bgp_getsockname(struct peer *peer)
}

peer->su_local = sockunion_getsockname(peer->connection->fd);
if (!peer->su_local)
return -1;
peer->su_remote = sockunion_getpeername(peer->connection->fd);
if (!peer->su_remote)

if (!peer->su_local || !peer->su_remote)
return -1;

if (!bgp_zebra_nexthop_set(peer->su_local, peer->su_remote,
Expand Down

0 comments on commit a6cee29

Please sign in to comment.