]> git.proxmox.com Git - mirror_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)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 10 Apr 2023 18:14:01 +0000 (14:14 -0400)
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>
bgpd/bgp_evpn.c

index 96feb19c29d03e99cbec771192ada90ae446cf8a..81117e94ef467384ecc6257a246af6fde7308acf 100644 (file)
@@ -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