]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Fix the json output of show bgp all json to be in a valid format
authorRajasekar Raja <rajasekarr@nvidia.com>
Mon, 22 May 2023 20:08:34 +0000 (13:08 -0700)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 23 May 2023 07:41:27 +0000 (07:41 +0000)
commitb62f4cf5c9aff9d9603a7a2228fa2744a3d03a65
treef6a9685ec78e50aa4c7baf0b31ed95a471f5d28b
parent4b3aa51ee790490b0f4f63a5b95d21280358f97d
bgpd: Fix the json output of show bgp all json to be in a valid format

In the json output of show bgp all json, the l2VpnEvpn afi-safi is
missing the 'routes' key making the json output format invalid.

Before Fix:
torm-11# sh bgp all json
{
<SNIP>....................
"l2VpnEvpn":{
{
  "27.0.0.15:2":{
    "rd":"27.0.0.15:2",
    "[4]:[03:44:38:39:ff:ff:01:00:00:01]:[32]:[27.0.0.15]":{
      "prefix":"[4]:[03:44:38:39:ff:ff:01:00:00:01]:[32]:[27.0.0.15]",
      "prefixLen":352,
      "paths":[
<SNIP>....................

After Fix:
torm-11# sh bgp all json
{
<SNIP>....................
"l2VpnEvpn":{
"routes":{
  "27.0.0.15:2":{
    "rd":"27.0.0.15:2",
    "[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]":{
      "prefix":"[1]:[0]:[03:44:38:39:ff:ff:01:00:00:01]:[128]:[::]:[0]",
      "prefixLen":352,
      "paths":[

Issue: 3472865
Ticket:#3472865

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit be66fa05c90bff66b7427e13ccb80bf8ecab2f38)
bgpd/bgp_route.c