summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2025-01-09 10:26:02 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2025-01-21 13:48:36 +0100
commit3a921c6a1d32cdc082714b4337bcb3ac3486d5ec (patch)
tree03adf23cde34e30c104f1e083222e666da19b2c1 /bgpd/bgp_vty.c
parentbgpd: fix duplicate BGP instance created with unified config (diff)
downloadfrr-3a921c6a1d32cdc082714b4337bcb3ac3486d5ec.tar.xz
frr-3a921c6a1d32cdc082714b4337bcb3ac3486d5ec.zip
bgpd: fix import vrf creates multiple bgp instances
The more the vrf green is referenced in the import bgp command, the more there are instances created. The below configuration shows that the vrf green is referenced twice, and two BGP instances of vrf green are created. The below configuration: > router bgp 99 > [..] > import vrf green > exit > router bgp 99 vrf blue > [..] > import vrf green > exit > router bgp 99 vrf green > [..] > exit > > r4# show bgp vrfs > Type Id routerId #PeersCfg #PeersEstb Name > L3-VNI RouterMAC Interface > DFLT 0 10.0.3.4 0 0 default > 0 00:00:00:00:00:00 unknown > VRF 5 10.0.40.4 0 0 blue > 0 00:00:00:00:00:00 unknown > VRF 6 0.0.0.0 0 0 green > 0 00:00:00:00:00:00 unknown > VRF 6 10.0.94.4 0 0 green > 0 00:00:00:00:00:00 unknown Fix this at import command, by looking at an already present bgp instance. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 8fefbeb49..3e71a8948 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -10561,7 +10561,7 @@ DEFPY(bgp_imexport_vrf, bgp_imexport_vrf_cmd,
SET_FLAG(bgp_default->flags, BGP_FLAG_INSTANCE_HIDDEN);
}
- vrf_bgp = bgp_lookup_by_name(import_name);
+ vrf_bgp = bgp_lookup_by_name_filter(import_name, false);
if (!vrf_bgp) {
if (strcmp(import_name, VRF_DEFAULT_NAME) == 0) {
vrf_bgp = bgp_default;