mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-17 21:38:11 +00:00
zebra: Replace prefix2str for JSON to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
15116b0069
commit
44991dc163
@ -1318,8 +1318,7 @@ static void connected_dump_vty(struct vty *vty, json_object *json,
|
|||||||
if (json) {
|
if (json) {
|
||||||
json_addr = json_object_new_object();
|
json_addr = json_object_new_object();
|
||||||
json_object_array_add(json, json_addr);
|
json_object_array_add(json, json_addr);
|
||||||
json_object_string_add(json_addr, "address",
|
json_object_string_addf(json_addr, "address", "%pFX", p);
|
||||||
prefix2str(p, buf, sizeof(buf)));
|
|
||||||
} else {
|
} else {
|
||||||
vty_out(vty, " %s %pFX", prefix_family_str(p), p);
|
vty_out(vty, " %s %pFX", prefix_family_str(p), p);
|
||||||
}
|
}
|
||||||
@ -1327,10 +1326,8 @@ static void connected_dump_vty(struct vty *vty, json_object *json,
|
|||||||
/* If there is destination address, print it. */
|
/* If there is destination address, print it. */
|
||||||
if (CONNECTED_PEER(connected) && connected->destination) {
|
if (CONNECTED_PEER(connected) && connected->destination) {
|
||||||
if (json) {
|
if (json) {
|
||||||
json_object_string_add(
|
json_object_string_addf(json_addr, "peer", "%pFX",
|
||||||
json_addr, "peer",
|
connected->destination);
|
||||||
prefix2str(connected->destination, buf,
|
|
||||||
sizeof(buf)));
|
|
||||||
} else {
|
} else {
|
||||||
vty_out(vty, " peer %pFX", connected->destination);
|
vty_out(vty, " peer %pFX", connected->destination);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user