summaryrefslogtreecommitdiff
path: root/zebra/zebra_evpn_neigh.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_evpn_neigh.c')
-rw-r--r--zebra/zebra_evpn_neigh.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/zebra/zebra_evpn_neigh.c b/zebra/zebra_evpn_neigh.c
index 860dc5b054..bb848255d0 100644
--- a/zebra/zebra_evpn_neigh.c
+++ b/zebra/zebra_evpn_neigh.c
@@ -1283,12 +1283,12 @@ zebra_evpn_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf, zebra_neigh_t *nbr,
if (nbr->dad_count >= zvrf->dad_max_moves) {
flog_warn(
EC_ZEBRA_DUP_IP_DETECTED,
- "VNI %u: MAC %s IP %s detected as duplicate during %s VTEP %s",
+ "VNI %u: MAC %s IP %s detected as duplicate during %s VTEP %pI4",
nbr->zevpn->vni,
prefix_mac2str(&nbr->emac, buf, sizeof(buf)),
ipaddr2str(&nbr->ip, buf1, sizeof(buf1)),
is_local ? "local update, last" : "remote update, from",
- inet_ntoa(vtep_ip));
+ &vtep_ip);
SET_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE);
@@ -1790,6 +1790,7 @@ void zebra_evpn_print_neigh(zebra_neigh_t *n, void *ctxt, json_object *json)
struct vty *vty;
char buf1[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
+ char addr_buf[PREFIX_STRLEN];
const char *type_str;
const char *state_str;
bool flags_present = false;
@@ -1867,11 +1868,13 @@ void zebra_evpn_print_neigh(zebra_neigh_t *n, void *ctxt, json_object *json)
n->mac->es->esi_str);
} else {
if (json)
- json_object_string_add(json, "remoteVtep",
- inet_ntoa(n->r_vtep_ip));
+ json_object_string_add(
+ json, "remoteVtep",
+ inet_ntop(AF_INET, &n->r_vtep_ip,
+ addr_buf, sizeof(addr_buf)));
else
- vty_out(vty, " Remote VTEP: %s\n",
- inet_ntoa(n->r_vtep_ip));
+ vty_out(vty, " Remote VTEP: %pI4\n",
+ &n->r_vtep_ip);
}
}
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_DEF_GW)) {
@@ -1952,6 +1955,7 @@ void zebra_evpn_print_neigh_hash(struct hash_bucket *bucket, void *ctxt)
zebra_neigh_t *n;
char buf1[ETHER_ADDR_STRLEN];
char buf2[INET6_ADDRSTRLEN];
+ char addr_buf[PREFIX_STRLEN];
struct neigh_walk_ctx *wctx = ctxt;
const char *state_str;
char flags_buf[6];
@@ -2006,12 +2010,16 @@ void zebra_evpn_print_neigh_hash(struct hash_bucket *bucket, void *ctxt)
if ((wctx->flags & SHOW_REMOTE_NEIGH_FROM_VTEP)
&& (wctx->count == 0))
zebra_evpn_print_neigh_hdr(vty, wctx);
+
+ if (n->mac->es == NULL)
+ inet_ntop(AF_INET, &n->r_vtep_ip,
+ addr_buf, sizeof(addr_buf));
+
vty_out(vty, "%*s %-6s %-5s %-8s %-17s %-30s %u/%u\n",
-wctx->addr_width, buf2, "remote",
zebra_evpn_print_neigh_flags(n, flags_buf,
sizeof(flags_buf)), state_str, buf1,
- n->mac->es ? n->mac->es->esi_str
- : inet_ntoa(n->r_vtep_ip),
+ n->mac->es ? n->mac->es->esi_str : addr_buf,
n->loc_seq, n->rem_seq);
} else {
json_object_string_add(json_row, "type", "remote");
@@ -2021,8 +2029,10 @@ void zebra_evpn_print_neigh_hash(struct hash_bucket *bucket, void *ctxt)
json_object_string_add(json_row, "remoteEs",
n->mac->es->esi_str);
else
- json_object_string_add(json_row, "remoteVtep",
- inet_ntoa(n->r_vtep_ip));
+ json_object_string_add(
+ json_row, "remoteVtep",
+ inet_ntop(AF_INET, &n->r_vtep_ip,
+ addr_buf, sizeof(addr_buf)));
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_DEF_GW))
json_object_boolean_true_add(json_row,
"defaultGateway");
@@ -2133,11 +2143,11 @@ void process_neigh_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf,
mac, 0);
if (!n) {
zlog_warn(
- "Failed to add Neigh %s MAC %s VNI %u Remote VTEP %s",
+ "Failed to add Neigh %s MAC %s VNI %u Remote VTEP %pI4",
ipaddr2str(ipaddr, buf1, sizeof(buf1)),
prefix_mac2str(&mac->macaddr, buf,
sizeof(buf)),
- zevpn->vni, inet_ntoa(vtep_ip));
+ zevpn->vni, &vtep_ip);
return;
}