bgpd: Add some asserts because of our linklist stuff

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-06-28 22:33:35 -04:00
parent 6a527b2fc1
commit b3a4db3dce
2 changed files with 3 additions and 0 deletions

View File

@ -4242,6 +4242,7 @@ void bgp_evpn_unconfigure_import_rt_for_vrf(struct bgp *bgp_vrf,
if (node_to_del)
list_delete_node(bgp_vrf->vrf_import_rtl, node_to_del);
assert(bgp_vrf->vrf_import_rtl);
/* fallback to auto import rt, if this was the last RT */
if (list_isempty(bgp_vrf->vrf_import_rtl)) {
UNSET_FLAG(bgp_vrf->vrf_flags, BGP_VRF_IMPORT_RT_CFGD);

View File

@ -1717,6 +1717,7 @@ static void evpn_unconfigure_import_rt(struct bgp *bgp, struct bgpevpn *vpn,
list_delete_node(vpn->import_rtl, node_to_del);
}
assert(vpn->import_rtl);
/* Reset to auto RT - this also rebuilds the RT to VNI mapping */
if (list_isempty(vpn->import_rtl)) {
UNSET_FLAG(vpn->flags, VNI_FLAG_IMPRT_CFGD);
@ -1784,6 +1785,7 @@ static void evpn_unconfigure_export_rt(struct bgp *bgp, struct bgpevpn *vpn,
list_delete_node(vpn->export_rtl, node_to_del);
}
assert(vpn->export_rtl);
if (list_isempty(vpn->export_rtl)) {
UNSET_FLAG(vpn->flags, VNI_FLAG_EXPRT_CFGD);
bgp_evpn_derive_auto_rt_export(bgp, vpn);