From 1ca42c8d84a3682a890f5cbcff760456df2e54a6 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Fri, 3 Sep 2021 19:39:53 +0300 Subject: [PATCH] bgpd: fix "no router bgp X vrf default" Currently, "vrf default" modifier is not processed correctly and we get the `% Can't find BGP instance` error. Signed-off-by: Igor Ryzhov --- bgpd/bgp_vty.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 92b74dd7cc..1e47a4cb7f 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -1387,8 +1387,12 @@ DEFUN (no_router_bgp, } else { as = strtoul(argv[idx_asn]->arg, NULL, 10); - if (argc > 4) + if (argc > 4) { name = argv[idx_vrf]->arg; + if (strmatch(argv[idx_vrf - 1]->text, "vrf") + && strmatch(name, VRF_DEFAULT_NAME)) + name = NULL; + } /* Lookup bgp structure. */ bgp = bgp_lookup(as, name); -- 2.39.5