Merge pull request #13247 from donaldsharp/evpn_crashes_and_other_ilk

Evpn crashes and other ilk
This commit is contained in:
Christian Hopps 2023-04-11 02:35:26 -04:00 committed by GitHub
commit 59cb833f6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 21 deletions

View File

@ -6235,6 +6235,14 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id,
l3vni); l3vni);
return -1; return -1;
} }
if (CHECK_FLAG(bgp_evpn->flags, BGP_FLAG_DELETE_IN_PROGRESS)) {
flog_err(EC_BGP_NO_DFLT,
"Cannot process L3VNI %u ADD - EVPN BGP instance is shutting down",
l3vni);
return -1;
}
as = bgp_evpn->as; as = bgp_evpn->as;
/* if the BGP vrf instance doesn't exist - create one */ /* if the BGP vrf instance doesn't exist - create one */
@ -6377,6 +6385,13 @@ int bgp_evpn_local_l3vni_del(vni_t l3vni, vrf_id_t vrf_id)
return -1; return -1;
} }
if (CHECK_FLAG(bgp_evpn->flags, BGP_FLAG_DELETE_IN_PROGRESS)) {
flog_err(EC_BGP_NO_DFLT,
"Cannot process L3VNI %u ADD - EVPN BGP instance is shutting down",
l3vni);
return -1;
}
/* Remove remote routes from BGT VRF even if BGP_VRF_AUTO is configured, /* Remove remote routes from BGT VRF even if BGP_VRF_AUTO is configured,
* bgp_delete would not remove/decrement bgp_path_info of the ip_prefix * bgp_delete would not remove/decrement bgp_path_info of the ip_prefix
* routes. This will uninstalling the routes from zebra and decremnt the * routes. This will uninstalling the routes from zebra and decremnt the

View File

@ -1103,7 +1103,7 @@ leak_update(struct bgp *to_bgp, struct bgp_dest *bn,
struct bgp_path_info *new; struct bgp_path_info *new;
struct bgp_path_info_extra *extra; struct bgp_path_info_extra *extra;
uint32_t num_sids = 0; uint32_t num_sids = 0;
void *parent = source_bpi; struct bgp_path_info *parent = source_bpi;
if (new_attr->srv6_l3vpn || new_attr->srv6_vpn) if (new_attr->srv6_l3vpn || new_attr->srv6_vpn)
num_sids = 1; num_sids = 1;
@ -1311,7 +1311,7 @@ leak_update(struct bgp *to_bgp, struct bgp_dest *bn,
new->extra->parent = bgp_path_info_lock(parent); new->extra->parent = bgp_path_info_lock(parent);
bgp_dest_lock_node( bgp_dest_lock_node(
(struct bgp_dest *)((struct bgp_path_info *)parent)->net); (struct bgp_dest *)parent->net);
if (bgp_orig) if (bgp_orig)
new->extra->bgp_orig = bgp_lock(bgp_orig); new->extra->bgp_orig = bgp_lock(bgp_orig);
if (nexthop_orig) if (nexthop_orig)

View File

@ -1675,28 +1675,46 @@ DEFUN (no_router_bgp,
for (ALL_LIST_ELEMENTS_RO(bm->bgp, node, tmp_bgp)) { for (ALL_LIST_ELEMENTS_RO(bm->bgp, node, tmp_bgp)) {
if (tmp_bgp->inst_type != BGP_INSTANCE_TYPE_VRF) if (tmp_bgp->inst_type != BGP_INSTANCE_TYPE_VRF)
continue; continue;
if (CHECK_FLAG(tmp_bgp->af_flags[AFI_IP][SAFI_UNICAST], if (CHECK_FLAG(
BGP_CONFIG_MPLSVPN_TO_VRF_IMPORT) || tmp_bgp->af_flags[AFI_IP]
CHECK_FLAG(tmp_bgp->af_flags[AFI_IP6][SAFI_UNICAST], [SAFI_UNICAST],
BGP_CONFIG_MPLSVPN_TO_VRF_IMPORT) || BGP_CONFIG_MPLSVPN_TO_VRF_IMPORT) ||
CHECK_FLAG(tmp_bgp->af_flags[AFI_IP][SAFI_UNICAST], CHECK_FLAG(
BGP_CONFIG_VRF_TO_MPLSVPN_EXPORT) || tmp_bgp->af_flags[AFI_IP6]
CHECK_FLAG(tmp_bgp->af_flags[AFI_IP6][SAFI_UNICAST], [SAFI_UNICAST],
BGP_CONFIG_VRF_TO_MPLSVPN_EXPORT) || BGP_CONFIG_MPLSVPN_TO_VRF_IMPORT) ||
CHECK_FLAG(tmp_bgp->af_flags[AFI_IP][SAFI_UNICAST], CHECK_FLAG(
tmp_bgp->af_flags[AFI_IP]
[SAFI_UNICAST],
BGP_CONFIG_VRF_TO_MPLSVPN_EXPORT) ||
CHECK_FLAG(
tmp_bgp->af_flags[AFI_IP6]
[SAFI_UNICAST],
BGP_CONFIG_VRF_TO_MPLSVPN_EXPORT) ||
CHECK_FLAG(tmp_bgp->af_flags[AFI_IP]
[SAFI_UNICAST],
BGP_CONFIG_VRF_TO_VRF_EXPORT) || BGP_CONFIG_VRF_TO_VRF_EXPORT) ||
CHECK_FLAG(tmp_bgp->af_flags[AFI_IP6][SAFI_UNICAST], CHECK_FLAG(tmp_bgp->af_flags[AFI_IP6]
[SAFI_UNICAST],
BGP_CONFIG_VRF_TO_VRF_EXPORT) || BGP_CONFIG_VRF_TO_VRF_EXPORT) ||
(bgp == bgp_get_evpn() && (bgp == bgp_get_evpn() &&
(CHECK_FLAG(tmp_bgp->af_flags[AFI_L2VPN][SAFI_EVPN], (CHECK_FLAG(
BGP_L2VPN_EVPN_ADV_IPV4_UNICAST) || tmp_bgp->af_flags[AFI_L2VPN]
CHECK_FLAG(tmp_bgp->af_flags[AFI_L2VPN][SAFI_EVPN], [SAFI_EVPN],
BGP_L2VPN_EVPN_ADV_IPV4_UNICAST_GW_IP) || BGP_L2VPN_EVPN_ADV_IPV4_UNICAST) ||
CHECK_FLAG(tmp_bgp->af_flags[AFI_L2VPN][SAFI_EVPN], CHECK_FLAG(
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST) || tmp_bgp->af_flags[AFI_L2VPN]
CHECK_FLAG(tmp_bgp->af_flags[AFI_L2VPN][SAFI_EVPN], [SAFI_EVPN],
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST_GW_IP))) || BGP_L2VPN_EVPN_ADV_IPV4_UNICAST_GW_IP) ||
(hashcount(tmp_bgp->vnihash))) { CHECK_FLAG(
tmp_bgp->af_flags[AFI_L2VPN]
[SAFI_EVPN],
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST) ||
CHECK_FLAG(
tmp_bgp->af_flags[AFI_L2VPN]
[SAFI_EVPN],
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST_GW_IP))) ||
(tmp_bgp->l3vni)) {
vty_out(vty, vty_out(vty,
"%% Cannot delete default BGP instance. Dependent VRF instances exist\n"); "%% Cannot delete default BGP instance. Dependent VRF instances exist\n");
return CMD_WARNING_CONFIG_FAILED; return CMD_WARNING_CONFIG_FAILED;