]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: fix proper json format for unicast statistics for non exists vrf 16725/head
authorSindhu Parvathi Gopinathan <sgopinathan@nvidia.com>
Mon, 26 Aug 2024 07:02:46 +0000 (00:02 -0700)
committerChirag Shah <chirag@nvidia.com>
Tue, 3 Sep 2024 00:22:01 +0000 (17:22 -0700)
commit40c0b891e38c4ee020470f80d1f5c1519cf8b5aa
tree92b4e261be0dc8dd7af6cae024cb6d212bb3b68d
parent745cd3e6bf298da16379088e138e33aeb0ee8f52
bgpd: fix proper json format for unicast statistics for non exists vrf

Ticket: #4060069

show bgp vrf afi unicast statistics json output is not return in json
format for non exists vrf.

Fix:
Json output is formatted for non exists vrf cases.

Command supported:

```
show bgp vrf <VRFNAME> ipv4/ipv6 unicast statistics json
show bgp vrf <VRFNAME> l2vpn evpn statistics json
```

Before Fix:

```
leaf11#
leaf11# show bgp vrf test ipv4 unicast statistics json
View/Vrf test is unknown
leaf11#
leaf11#
leaf11# show bgp vrf test ipv6 unicast statistics json
View/Vrf test is unknown
leaf11#
leaf11#
leaf11# show bgp vrf default1 l2vpn evpn statistics json
View/Vrf default1 is unknown
leaf11#

```

After Fix:

```
leaf11#
leaf11# show bgp vrf test ipv4 unicast statistics json
{
  "warning":"View/Vrf is unknown"
}
leaf11#
leaf11#
leaf11# show bgp vrf test ipv6 unicast statistics json
{
  "warning":"View/Vrf is unknown"
}
leaf11#
leaf11# show bgp vrf default1 l2vpn evpn statistics json
{
  "warning":"View/Vrf is unknown"
}
leaf11#
```

Ticket: #4060069

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
bgpd/bgp_route.c