mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 15:21:24 +00:00
Merge pull request #3424 from donaldsharp/show_ip_route_json
zebra: `show ip route A.B.C.D json` would only show last route entry
This commit is contained in:
commit
ca305e9ad8
@ -732,15 +732,14 @@ static void vty_show_ip_route_detail_json(struct vty *vty,
|
||||
char buf[BUFSIZ];
|
||||
|
||||
json = json_object_new_object();
|
||||
json_prefix = json_object_new_array();
|
||||
|
||||
RNODE_FOREACH_RE (rn, re) {
|
||||
json_prefix = json_object_new_array();
|
||||
vty_show_ip_route(vty, rn, re, json_prefix);
|
||||
prefix2str(&rn->p, buf, sizeof buf);
|
||||
json_object_object_add(json, buf, json_prefix);
|
||||
json_prefix = NULL;
|
||||
}
|
||||
|
||||
prefix2str(&rn->p, buf, sizeof(buf));
|
||||
json_object_object_add(json, buf, json_prefix);
|
||||
vty_out(vty, "%s\n", json_object_to_json_string_ext(
|
||||
json, JSON_C_TO_STRING_PRETTY));
|
||||
json_object_free(json);
|
||||
|
Loading…
Reference in New Issue
Block a user