bgpd: fix wrong check for default VRF

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>
This commit is contained in:
anlan_cs 2022-04-13 04:51:38 -04:00
parent 695c24c3b0
commit 4a5271a56b

View 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");