summaryrefslogtreecommitdiff
path: root/zebra/zebra_evpn.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-10-22 18:39:04 -0400
committerGitHub <noreply@github.com>2020-10-22 18:39:04 -0400
commitb7f49e15a2fea2cb1676c921a5e68f974f9c3f33 (patch)
tree5ce62762bb16b2f2a6d983f860f6b4c4f63e44e8 /zebra/zebra_evpn.c
parentcc1107bf59ab88f7f19bfefb540d3b5cc63df3f3 (diff)
parentd0b0a2c545c2960df768e86a0bdb2e78610efc86 (diff)
Merge pull request #7358 from mjstapp/fix_ntoa
ospfd, zebra: Replace use of inet_ntoa
Diffstat (limited to 'zebra/zebra_evpn.c')
-rw-r--r--zebra/zebra_evpn.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/zebra/zebra_evpn.c b/zebra/zebra_evpn.c
index e1dbd04def..6722af117c 100644
--- a/zebra/zebra_evpn.c
+++ b/zebra/zebra_evpn.c
@@ -109,6 +109,7 @@ void zebra_evpn_print(zebra_evpn_t *zevpn, void **ctxt)
json_object *json = NULL;
json_object *json_vtep_list = NULL;
json_object *json_ip_str = NULL;
+ char buf[PREFIX_STRLEN];
vty = ctxt[0];
json = ctxt[1];
@@ -134,18 +135,20 @@ void zebra_evpn_print(zebra_evpn_t *zevpn, void **ctxt)
if (json == NULL) {
vty_out(vty, " VxLAN interface: %s\n", zevpn->vxlan_if->name);
vty_out(vty, " VxLAN ifIndex: %u\n", zevpn->vxlan_if->ifindex);
- vty_out(vty, " Local VTEP IP: %s\n",
- inet_ntoa(zevpn->local_vtep_ip));
- vty_out(vty, " Mcast group: %s\n",
- inet_ntoa(zevpn->mcast_grp));
+ vty_out(vty, " Local VTEP IP: %pI4\n",
+ &zevpn->local_vtep_ip);
+ vty_out(vty, " Mcast group: %pI4\n",
+ &zevpn->mcast_grp);
} else {
json_object_string_add(json, "vxlanInterface",
zevpn->vxlan_if->name);
json_object_int_add(json, "ifindex", zevpn->vxlan_if->ifindex);
json_object_string_add(json, "vtepIp",
- inet_ntoa(zevpn->local_vtep_ip));
+ inet_ntop(AF_INET, &zevpn->local_vtep_ip,
+ buf, sizeof(buf)));
json_object_string_add(json, "mcastGroup",
- inet_ntoa(zevpn->mcast_grp));
+ inet_ntop(AF_INET, &zevpn->mcast_grp,
+ buf, sizeof(buf)));
json_object_string_add(json, "advertiseGatewayMacip",
zevpn->advertise_gw_macip ? "Yes" : "No");
json_object_int_add(json, "numMacs", num_macs);
@@ -165,12 +168,14 @@ void zebra_evpn_print(zebra_evpn_t *zevpn, void **ctxt)
VXLAN_FLOOD_STR_DEFAULT);
if (json == NULL) {
- vty_out(vty, " %s flood: %s\n",
- inet_ntoa(zvtep->vtep_ip),
+ vty_out(vty, " %pI4 flood: %s\n",
+ &zvtep->vtep_ip,
flood_str);
} else {
json_ip_str = json_object_new_string(
- inet_ntoa(zvtep->vtep_ip));
+ inet_ntop(AF_INET,
+ &zvtep->vtep_ip, buf,
+ sizeof(buf)));
json_object_array_add(json_vtep_list,
json_ip_str);
}
@@ -207,6 +212,7 @@ void zebra_evpn_print_hash(struct hash_bucket *bucket, void *ctxt[])
json_object *json_evpn = NULL;
json_object *json_ip_str = NULL;
json_object *json_vtep_list = NULL;
+ char buf[PREFIX_STRLEN];
vty = ctxt[0];
json = ctxt[1];
@@ -245,7 +251,8 @@ void zebra_evpn_print_hash(struct hash_bucket *bucket, void *ctxt[])
json_vtep_list = json_object_new_array();
for (zvtep = zevpn->vteps; zvtep; zvtep = zvtep->next) {
json_ip_str = json_object_new_string(
- inet_ntoa(zvtep->vtep_ip));
+ inet_ntop(AF_INET, &zvtep->vtep_ip, buf,
+ sizeof(buf)));
json_object_array_add(json_vtep_list,
json_ip_str);
}
@@ -1074,8 +1081,8 @@ int zebra_evpn_send_add_to_client(zebra_evpn_t *zevpn)
stream_putw_at(s, 0, stream_get_endp(s));
if (IS_ZEBRA_DEBUG_VXLAN)
- zlog_debug("Send EVPN_ADD %u %s tenant vrf %s to %s", zevpn->vni,
- inet_ntoa(zevpn->local_vtep_ip),
+ zlog_debug("Send EVPN_ADD %u %pI4 tenant vrf %s to %s", zevpn->vni,
+ &zevpn->local_vtep_ip,
vrf_id_to_name(zevpn->vrf_id),
zebra_route_string(client->proto));