summaryrefslogtreecommitdiff
path: root/bgpd/bgp_evpn_mh.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-11-18 10:55:47 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-11-18 11:35:29 +0200
commitc949c77101d2e862b401e9ccf3c09c7b7d024ba9 (patch)
tree5241f98e42a3fda29f1dbf5a0ab00f9c4df598c8 /bgpd/bgp_evpn_mh.c
parent8b3c84254d252394800672a2ecf1d017ce20df87 (diff)
bgpd: Replace inet_ntop to %pI4/6 for JSON outputs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/bgp_evpn_mh.c')
-rw-r--r--bgpd/bgp_evpn_mh.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c
index 9316d218a2..8bfddf2bb9 100644
--- a/bgpd/bgp_evpn_mh.c
+++ b/bgpd/bgp_evpn_mh.c
@@ -2195,9 +2195,8 @@ static void bgp_evpn_es_json_vtep_fill(json_object *json_vteps,
json_vtep_entry = json_object_new_object();
- json_object_string_add(
- json_vtep_entry, "vtep_ip",
- inet_ntop(AF_INET, &es_vtep->vtep_ip, ip_buf, sizeof(ip_buf)));
+ json_object_string_addf(json_vtep_entry, "vtep_ip", "%pI4",
+ &es_vtep->vtep_ip);
if (es_vtep->flags & (BGP_EVPNES_VTEP_ESR |
BGP_EVPNES_VTEP_ACTIVE)) {
json_flags = json_object_new_array();
@@ -2338,9 +2337,8 @@ static void bgp_evpn_es_show_entry_detail(struct vty *vty,
json_array_string_add(json_flags, "bypass");
json_object_object_add(json, "flags", json_flags);
}
- json_object_string_add(json, "originator_ip",
- inet_ntop(AF_INET, &es->originator_ip,
- ip_buf, sizeof(ip_buf)));
+ json_object_string_addf(json, "originator_ip", "%pI4",
+ &es->originator_ip);
json_object_int_add(json, "remoteVniCount",
es->remote_es_evi_cnt);
json_object_int_add(json, "vrfCount",
@@ -3718,9 +3716,8 @@ static void bgp_evpn_es_evi_json_vtep_fill(json_object *json_vteps,
json_vtep_entry = json_object_new_object();
- json_object_string_add(
- json_vtep_entry, "vtep_ip",
- inet_ntop(AF_INET, &evi_vtep->vtep_ip, ip_buf, sizeof(ip_buf)));
+ json_object_string_addf(json_vtep_entry, "vtep_ip", "%pI4",
+ &evi_vtep->vtep_ip);
if (evi_vtep->flags & (BGP_EVPN_EVI_VTEP_EAD_PER_ES |
BGP_EVPN_EVI_VTEP_EAD_PER_EVI)) {
json_flags = json_object_new_array();