]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix static analysis issue in subgroup_announce_check() 13524/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 2 Jun 2023 08:10:45 +0000 (10:10 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 16 Jun 2023 08:55:17 +0000 (10:55 +0200)
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 <philippe.guibert@6wind.com>
bgpd/bgp_route.c

index b267f0d6bd842ae8dbd5196295e17f85bf254f1d..b60cd0ebb1e30002bc2d91fce910bdfbc6bb93aa 100644 (file)
@@ -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) &&