summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-11-18 10:58:23 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-11-18 18:45:41 +0200
commit08edf9c6af87489c06b7fe45f92d2be09e6622bc (patch)
tree5ec31bcd90c8431708e074a992fb2cd5fdcc2767 /zebra/zebra_mpls.c
parentb0d5264e3ff279414b7adb22f5e0ddf70d2c5773 (diff)
zebra: Replace inet_ntop to %pI4/6 for JSON outputs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'zebra/zebra_mpls.c')
-rw-r--r--zebra/zebra_mpls.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index 00ac98cbc0..e32905f586 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -1531,15 +1531,13 @@ static json_object *nhlfe_json(struct zebra_nhlfe *nhlfe)
switch (nexthop->type) {
case NEXTHOP_TYPE_IPV4:
case NEXTHOP_TYPE_IPV4_IFINDEX:
- json_object_string_add(json_nhlfe, "nexthop",
- inet_ntop(AF_INET, &nexthop->gate.ipv4,
- buf, sizeof(buf)));
+ json_object_string_addf(json_nhlfe, "nexthop", "%pI4",
+ &nexthop->gate.ipv4);
break;
case NEXTHOP_TYPE_IPV6:
case NEXTHOP_TYPE_IPV6_IFINDEX:
- json_object_string_add(
- json_nhlfe, "nexthop",
- inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
+ json_object_string_addf(json_nhlfe, "nexthop", "%pI6",
+ &nexthop->gate.ipv6);
if (nexthop->ifindex)
json_object_string_add(json_nhlfe, "interface",