diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-04-10 13:59:48 -0400 | 
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-11 06:36:08 +0000 | 
| commit | 4d57481211ffd8cdd06bddb2a46501c4de831621 (patch) | |
| tree | 79995fdd60ffb8f97b03fb6e886c5f580e749499 /bgpd/bgp_evpn.c | |
| parent | 3235edd171af74afdc1166d31cf03f723b20447e (diff) | |
bgpd: Do not allow l3vni changes when shutting down
When a `no router bgp XXX` is issued and the bgp instance
is in the process of shutting down, do not allow a l3vni
change coming up from zebra to do anything.  We can just
safely ignore it at this point in time.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 5a7c43c77ed27522e1e655795d5451c888abb10e)
Diffstat (limited to 'bgpd/bgp_evpn.c')
| -rw-r--r-- | bgpd/bgp_evpn.c | 15 | 
1 files changed, 15 insertions, 0 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 9c6624e27f..16b7dc3f4e 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -5564,6 +5564,14 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id,  			l3vni);  		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;  	/* if the BGP vrf instance doesn't exist - create one */ @@ -5703,6 +5711,13 @@ int bgp_evpn_local_l3vni_del(vni_t l3vni, vrf_id_t vrf_id)  		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,  	 * bgp_delete would not remove/decrement bgp_path_info of the ip_prefix  	 * routes. This will uninstalling the routes from zebra and decremnt the  | 
