From b2ee5a130b985458465515de252f1f2c027e6547 Mon Sep 17 00:00:00 2001 From: Mitesh Kanjariya Date: Tue, 17 Oct 2017 03:14:14 -0700 Subject: [PATCH] zebra: json support for show evpn l3vni vni command Signed-off-by: Mitesh Kanjariya --- zebra/zebra_vxlan.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 33af3534e..a9d9d217a 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3910,11 +3910,11 @@ void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, u_char use_json) json_object *json = NULL; zebra_l3vni_t *zl3vni = NULL; - args[0] = vty; - args[1] = json; - - if (!is_evpn_enabled()) + if (!is_evpn_enabled()) { + if (use_json) + vty_out(vty, "{}\n"); return; + } zl3vni = zl3vni_lookup(vni); if (!zl3vni) { @@ -3928,6 +3928,8 @@ void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, u_char use_json) if (use_json) json = json_object_new_object(); + args[0] = vty; + args[1] = json; zl3vni_print(zl3vni, (void *)args); if (use_json) { -- 2.39.5