Skip to content

Commit

Permalink
Merge pull request FRRouting#14076 from chiragshah6/fdev1
Browse files Browse the repository at this point in the history
zebra: non pretty json format for rib and evpn operational commands
  • Loading branch information
ton31337 authored Jul 22, 2023
2 parents 202c73c + fadf87f commit 9e32b73
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion zebra/zebra_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,12 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
}
}

/*
* This is an extremely expensive operation at scale
* and non-pretty reduces memory footprint significantly.
*/
if (use_json)
vty_json(vty, json);
vty_json_no_pretty(vty, json);
}

static void do_show_ip_route_all(struct vty *vty, struct zebra_vrf *zvrf,
Expand Down
12 changes: 10 additions & 2 deletions zebra/zebra_vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -3229,7 +3229,11 @@ void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf,

if (use_json) {
json_object_object_add(json, "macs", json_mac);
vty_json(vty, json);
/*
* This is an extremely expensive operation at scale
* and non-pretty reduces memory footprint significantly.
*/
vty_json_no_pretty(vty, json);
}
}

Expand Down Expand Up @@ -4014,8 +4018,12 @@ void zebra_vxlan_print_vnis_detail(struct vty *vty, struct zebra_vrf *zvrf,
void *))zl3vni_print_hash_detail,
&zes);

/*
* This is an extremely expensive operation at scale
* and non-pretty reduces memory footprint significantly.
*/
if (use_json)
vty_json(vty, json_array);
vty_json_no_pretty(vty, json_array);
}

/*
Expand Down

0 comments on commit 9e32b73

Please sign in to comment.