From: Donald Sharp Date: Mon, 10 Apr 2023 17:59:48 +0000 (-0400) Subject: bgpd: Do not allow l3vni changes when shutting down X-Git-Tag: base_9.0~210^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5a7c43c77ed27522e1e655795d5451c888abb10e;p=matthieu%2Ffrr.git 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 --- diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 96feb19c29..81117e94ef 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -6235,6 +6235,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 */ @@ -6377,6 +6385,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