zebra: Replace prefix2str for JSON to %pFX

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
Donatas Abraitis 2021-11-25 17:28:12 +02:00
parent 15116b0069
commit 44991dc163

View File

@ -1318,8 +1318,7 @@ static void connected_dump_vty(struct vty *vty, json_object *json,
if (json) {
json_addr = json_object_new_object();
json_object_array_add(json, json_addr);
json_object_string_add(json_addr, "address",
prefix2str(p, buf, sizeof(buf)));
json_object_string_addf(json_addr, "address", "%pFX", p);
} else {
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 (CONNECTED_PEER(connected) && connected->destination) {
if (json) {
json_object_string_add(
json_addr, "peer",
prefix2str(connected->destination, buf,
sizeof(buf)));
json_object_string_addf(json_addr, "peer", "%pFX",
connected->destination);
} else {
vty_out(vty, " peer %pFX", connected->destination);
}