diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-11 12:41:55 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-25 12:39:17 -0400 |
| commit | 89d5934783f4da13775f52b2a287aca4df3079cd (patch) | |
| tree | 233043f8e4d333ee0095c910179e52d39a5cc996 | |
| parent | 020a3f60bdffb4d322202bbf314c35bef8aa840a (diff) | |
bgpd: Fix SA warning found by clang.
Quiet the SA warning, with an assert.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| -rw-r--r-- | bgpd/bgp_mplsvpn.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index e0f5e2bc0a..ca8ffdffcd 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -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. */ |
