]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Fix SA warning found by clang.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 11 Apr 2018 16:41:55 +0000 (12:41 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 25 Apr 2018 16:39:17 +0000 (12:39 -0400)
Quiet the SA warning, with an assert.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_mplsvpn.c

index e0f5e2bc0a6fafeea4c2570b71894f035af72212..ca8ffdffcd8b851ac034e3aee2d69dfe72ef2269 100644 (file)
@@ -1557,6 +1557,18 @@ void vrf_unimport_from_vrf(struct bgp *bgp, struct bgp *vrf_bgp,
                vpn_leak_postchange(idir, afi, bgp_get_default(), bgp);
        }
 
+       /*
+        * What?
+        * So SA is assuming that since the ALL_LIST_ELEMENTS_RO
+        * below is checking for NULL that export_vrf can be
+        * NULL, consequently it is complaining( like a cabbage )
+        * that we could dereference and crash in the listcount(..)
+        * check below.
+        * So make it happy, under protest, with liberty and justice
+        * for all.
+        */
+       assert(vrf_bgp->vpn_policy[afi].export_vrf);
+
        /* Remove us from "import_vrf's" export list. If no other VRF
         * is importing from "import_vrf", cleanup appropriately.
         */