From: Mitesh Kanjariya Date: Tue, 17 Oct 2017 12:14:33 +0000 (-0700) Subject: zebra: json support for show evpn rmac vni command X-Git-Tag: frr-4.0-dev~58^2~43 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=75223c9e4a933105b8d705d6ba7dc114d5af9a04;p=matthieu%2Ffrr.git zebra: json support for show evpn rmac vni command Signed-off-by: Mitesh Kanjariya --- diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 915e07045d..6220345cc9 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3724,7 +3724,6 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, u_int32_t num_rmacs; struct rmac_walk_ctx wctx; json_object *json = NULL; - json_object *json_rmac = NULL; if (!is_evpn_enabled()) return; @@ -3741,15 +3740,12 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, if (!num_rmacs) return; - if (use_json) { + if (use_json) json = json_object_new_object(); - json_rmac = json_object_new_array(); - } memset(&wctx, 0, sizeof(struct rmac_walk_ctx)); wctx.vty = vty; - wctx.json = json_rmac; - + wctx.json = json; if (!use_json) { vty_out(vty, "Number of Remote RMACs known for this VNI: %u\n", @@ -3762,7 +3758,6 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, hash_iterate(zl3vni->rmac_table, zl3vni_print_rmac_hash, &wctx); if (use_json) { - json_object_object_add(json, "rmacs", json_rmac); vty_out(vty, "%s\n", json_object_to_json_string_ext( json, JSON_C_TO_STRING_PRETTY)); json_object_free(json);