]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: fix json for show evpn arp-cache vni vtep
authorPat Ruddy <pat@voltanet.io>
Wed, 29 Apr 2020 11:22:14 +0000 (12:22 +0100)
committerPat Ruddy <pat@voltanet.io>
Wed, 29 Apr 2020 11:29:09 +0000 (12:29 +0100)
The function zebra_vxlan_print_neigh_vni_vtep does not create
a json object when json has been requested from the CLI and as a
result it prints out the information in normal CLI format.
Fix is to allocate the json object when required.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
zebra/zebra_vxlan.c

index b9e7251117a5139513e90e9d08d014dcf9311756..d85f48e570cef5418e7ce4f4f3f473ef9349fb8c 100644 (file)
@@ -6523,6 +6523,9 @@ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
        if (!num_neigh)
                return;
 
+       if (use_json)
+               json = json_object_new_object();
+
        memset(&wctx, 0, sizeof(struct neigh_walk_ctx));
        wctx.zvni = zvni;
        wctx.vty = vty;