struct bgp *bgp_vrf = NULL; /* bgp vrf instance */
struct bgp *bgp_def = NULL; /* default bgp instance */
struct listnode *node = NULL;
+ struct listnode *next = NULL;
struct bgpevpn *vpn = NULL;
bgp_vrf = bgp_lookup_by_vrf_id(vrf_id);
}
}
+ /* If any L2VNIs point to this instance, unlink them. */
+ for (ALL_LIST_ELEMENTS(bgp_vrf->l2vnis, node, next, vpn))
+ bgpevpn_unlink_from_l3vni(vpn);
+
/* Delete the instance if it was autocreated */
if (CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_AUTO))
bgp_delete(bgp_vrf);