]> 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)
committerPiotr Suchy <psuchy@akamai.com>
Fri, 29 Mar 2024 13:01:21 +0000 (14:01 +0100)
commit0e2fc3d67f1d358896a764373f41cb59c095eda9
tree852c6636c9bf4b3ad43bcf31f1b08cf239a7edb2
parentd5f17cd51e6e5fcef4c8b8509a3538d655dadf36
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>
zebra/zebra_vty.c