bgpd: remove useless control checks about TCP connection

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: 1ff9a34058 ("bgpd: bgpd-fsm-fix.patch")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit ba71303099)
This commit is contained in:
Philippe Guibert 2024-04-05 13:52:27 +02:00 committed by Mergify
parent a1270992b4
commit d9ba5bd55e

View File

@ -876,11 +876,7 @@ int bgp_getsockname(struct peer *peer)
} }
peer->su_local = sockunion_getsockname(peer->connection->fd); peer->su_local = sockunion_getsockname(peer->connection->fd);
if (!peer->su_local)
return -1;
peer->su_remote = sockunion_getpeername(peer->connection->fd); 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, if (!bgp_zebra_nexthop_set(peer->su_local, peer->su_remote,
&peer->nexthop, peer)) { &peer->nexthop, peer)) {