]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix wrong check for default VRF
authoranlan_cs <vic.lan@pica8.com>
Wed, 13 Apr 2022 08:51:38 +0000 (04:51 -0400)
committeranlan_cs <vic.lan@pica8.com>
Wed, 13 Apr 2022 09:00:33 +0000 (05:00 -0400)
Currently the warning is wrong:
```
root#show bgp vrf default vni
BGP instance for VRF default not foundACC1(config)#
```

Two changes for "show bgp vrf VRFNAME vni [json]":
- Correct the default VRF check
- Add newline for warning

Signed-off-by: anlan_cs <vic.lan@pica8.com>
bgpd/bgp_evpn_vty.c

index 5f519e84ed3f268831e9a8c658dafe8e3d87d43e..62459a03fe157a218951192eaba8070e349624c6 100644 (file)
@@ -5747,9 +5747,13 @@ DEFUN (show_bgp_vrf_l3vni_info,
 
        name = argv[idx_vrf]->arg;
        bgp = bgp_lookup_by_name(name);
+       if (strmatch(name, VRF_DEFAULT_NAME))
+               bgp = bgp_get_default();
+
        if (!bgp) {
                if (!uj)
-                       vty_out(vty, "BGP instance for VRF %s not found", name);
+                       vty_out(vty, "BGP instance for VRF %s not found\n",
+                               name);
                else {
                        json_object_string_add(json, "warning",
                                               "BGP instance not found");