From 0ed9c490d3cd2fe3a563cf28f6301127e9193b8f Mon Sep 17 00:00:00 2001 From: Piotr Suchy Date: Wed, 22 May 2024 10:41:52 +0200 Subject: [PATCH] bgpd: Ignore routes from evpn if VRF is unknown Fix for a bug, where FRR fails to install route received for an unknown but later-created VRF - detailed description can be found here https://github.com/FRRouting/frr/issues/13708 Signed-off-by: Piotr Suchy --- bgpd/bgp_evpn.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 5d6a5a59f520..51c6812cb185 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -3037,6 +3037,14 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf, vrf_id_to_name(bgp_vrf->vrf_id), evp, parent_pi, parent_pi->flags); + if (bgp_vrf->vrf_id == VRF_UNKNOWN) { + if (bgp_debug_zebra(NULL)) + zlog_debug( + "vrf %s: vrf_id not set, evpn route not installed", + vrf_id_to_name(bgp_vrf->vrf_id)); + return -1; + } + /* Create (or fetch) route within the VRF. */ /* NOTE: There is no RD here. */ if (is_evpn_prefix_ipaddr_v4(evp)) {