From: Mark Stapp Date: Wed, 7 Apr 2021 14:42:56 +0000 (-0400) Subject: bgpd, nhrpd: fix clang static analysis warnings in 7.5 branch X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1ca60ce86a5bc255a1d32e5254eb36677c672704;p=matthieu%2Ffrr.git bgpd, nhrpd: fix clang static analysis warnings in 7.5 branch Clean up a couple of SA warnings in the 7.5 branch. Signed-off-by: Mark Stapp --- diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index e47a4d6507..69996e3a1b 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -801,6 +801,10 @@ static void bgp_evpn_type1_es_route_extcomm_build(struct bgp_evpn_es *es, evi_node, es_evi)) { if (!CHECK_FLAG(es_evi->flags, BGP_EVPNES_EVI_LOCAL)) continue; + + /* Help SA understand the following loop */ + assert(es_evi->vpn != NULL); + for (ALL_LIST_ELEMENTS_RO(es_evi->vpn->export_rtl, rt_node, ecom)) attr->ecommunity = ecommunity_merge(attr->ecommunity, diff --git a/nhrpd/nhrp_main.c b/nhrpd/nhrp_main.c index 9fc13761c8..ba4bab00b7 100644 --- a/nhrpd/nhrp_main.c +++ b/nhrpd/nhrp_main.c @@ -146,6 +146,7 @@ int main(int argc, char **argv) /* Run with elevated capabilities, as for all netlink activity * we need privileges anyway. */ + assert(nhrpd_privs.change); nhrpd_privs.change(ZPRIVS_RAISE); netlink_init();