From: Philippe Guibert Date: Fri, 2 Jun 2023 08:10:45 +0000 (+0200) Subject: bgpd: fix static analysis issue in subgroup_announce_check() X-Git-Tag: base_9.1~351^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=961b8981976c797e23c307b9a82a83115d8bd61c;p=mirror%2Ffrr.git bgpd: fix static analysis issue in subgroup_announce_check() Remove the check about pi->peer value different from null. Introducing this check introduces a SA warning on the value of the from value (derived from pi->peer). Actually, peer is set when bgp_path_info_make() call is performed; peer is never null. Fixes: 23bb4a9b5c64 ("bgpd: advertise mpls vpn routes with appropriate label") Signed-off-by: Philippe Guibert --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index b267f0d6bd..b60cd0ebb1 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2116,7 +2116,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi, } } else if (safi == SAFI_MPLS_VPN && CHECK_FLAG(pi->flags, BGP_PATH_MPLSVPN_NH_LABEL_BIND) && - pi->mplsvpn.bmnc.nh_label_bind_cache && from && peer && + pi->mplsvpn.bmnc.nh_label_bind_cache && peer && pi->peer != peer && pi->sub_type != BGP_ROUTE_IMPORTED && pi->sub_type != BGP_ROUTE_STATIC && bgp_mplsvpn_path_uses_valid_mpls_label(pi) &&