From: Philippe Guibert Date: Fri, 5 Apr 2024 11:52:27 +0000 (+0200) Subject: bgpd: remove useless control checks about TCP connection X-Git-Tag: docker/10.0.3~15^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=862a15da9b176b324aa85c15f0eb8b4f10ebbf1b;p=mirror%2Ffrr.git 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: 1ff9a340588a ("bgpd: bgpd-fsm-fix.patch") Signed-off-by: Philippe Guibert (cherry picked from commit ba7130309954fbe8d58854339ca43259149e603a) --- diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index dbb34b048f..b409cbe706 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -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)) {