]> git.puffer.fish Git - matthieu/frr.git/commit
vtysh, zebra: Fix malformed json output for multiple vrfs in command 'show ip route...
authorPiotr Suchy <psuchy@akamai.com>
Thu, 28 Mar 2024 11:55:35 +0000 (12:55 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sat, 30 Mar 2024 20:39:41 +0000 (20:39 +0000)
commiteb707e756fac3c092f4b54a09794967459b1a002
tree6f17f1406d47bc8d6f349c08ea09fa6070bc22e9
parentb5edaf7739340a70edbb4b839cac235525068b1d
vtysh, zebra: Fix malformed json output for multiple vrfs in command 'show ip route vrf all json'

Command 'show ip route vrf <vrf_name> json' returns a valid json object,
however if instead of <vrf_name> we specify 'all', we get an invalid json
object, like:

{//vrf1 routes}{//vrf2 routes}{vrf3 routes}

After the fix:

{"vrf1":{//vrf1 routes},"vrf2:{//vrf2 routes},"vrf3":{//vrf3 routes}}

Which is a valid json object, that can be parsed effectively using built-in
modules. The rest of the commands remains unaffected and behave the same.

Signed-off-by: Piotr Suchy <psuchy@akamai.com>
(cherry picked from commit 0e2fc3d67f1d358896a764373f41cb59c095eda9)
zebra/zebra_vty.c