]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd, nhrpd: fix clang static analysis warnings in 7.5 branch
authorMark Stapp <mjs@voltanet.io>
Wed, 7 Apr 2021 14:42:56 +0000 (10:42 -0400)
committerMark Stapp <mjs@voltanet.io>
Wed, 7 Apr 2021 14:42:56 +0000 (10:42 -0400)
Clean up a couple of SA warnings in the 7.5 branch.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
bgpd/bgp_evpn_mh.c
nhrpd/nhrp_main.c

index e47a4d65071af9c5cd427a68dd61feb87d4974bc..69996e3a1b8a554404427c7bb0240c545bf605c8 100644 (file)
@@ -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,
index 9fc13761c801b832c7c15b4f946dd15762d01f1d..ba4bab00b77277903c229ea9fa7290c228a07606 100644 (file)
@@ -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();