Skip to content

Commit

Permalink
bgpd: remove useless control checks about TCP connection
Browse files Browse the repository at this point in the history
When attempting to get the src and destination addresses of a given
connection, the API may return the NULL pointer, but further code
in bgp_zebra_nexthop_set() already does a check about the given
pointer.

Relaxing the error code for all the returned adressing.

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

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Apr 15, 2024
1 parent cc04847 commit ba71303
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions bgpd/bgp_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,11 +875,7 @@ 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)
return -1;

if (!bgp_zebra_nexthop_set(peer->su_local, peer->su_remote,
&peer->nexthop, peer)) {
Expand Down

0 comments on commit ba71303

Please sign in to comment.