]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Do not allow l3vni changes when shutting down
authorDonald Sharp <sharpd@nvidia.com>
Mon, 10 Apr 2023 17:59:48 +0000 (13:59 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 11 Apr 2023 06:36:08 +0000 (06:36 +0000)
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)

bgpd/bgp_evpn.c

index 9c6624e27fbcceddf8dc5ee10ed21311851dca88..16b7dc3f4ed4581c4908c89234cf480df0e876d7 100644 (file)
@@ -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