isisd: replace inet_ntoa

Replace use of inet_ntoa, using pI4

Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
Mark Stapp 2020-10-22 14:30:34 -04:00
parent 2bd8bc157d
commit a854ea43ed
3 changed files with 19 additions and 22 deletions

View File

@ -393,7 +393,7 @@ void isis_adj_print(struct isis_adjacency *adj)
if (adj->ipv4_address_count) {
zlog_debug("IPv4 Address(es):");
for (unsigned int i = 0; i < adj->ipv4_address_count; i++)
zlog_debug("%s", inet_ntoa(adj->ipv4_addresses[i]));
zlog_debug("%pI4", &adj->ipv4_addresses[i]);
}
if (adj->ipv6_address_count) {
@ -562,8 +562,8 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
vty_out(vty, " IPv4 Address(es):\n");
for (unsigned int i = 0; i < adj->ipv4_address_count;
i++)
vty_out(vty, " %s\n",
inet_ntoa(adj->ipv4_addresses[i]));
vty_out(vty, " %pI4\n",
&adj->ipv4_addresses[i]);
}
if (adj->ipv6_address_count) {
vty_out(vty, " IPv6 Address(es):\n");

View File

@ -336,10 +336,8 @@ DEFUN(show_isis_mpls_te_router,
if (ntohs(area->mta->router_id.s_addr)
!= 0)
vty_out(vty,
" MPLS-TE Router-Address: %s\n",
inet_ntoa(
area->mta
->router_id));
" MPLS-TE Router-Address: %pI4\n",
&area->mta->router_id);
else
vty_out(vty, " N/A\n");
}
@ -357,9 +355,8 @@ DEFUN(show_isis_mpls_te_router,
vty_out(vty, "Area %s:\n", area->area_tag);
if (ntohs(area->mta->router_id.s_addr) != 0)
vty_out(vty,
" MPLS-TE Router-Address: %s\n",
inet_ntoa(
area->mta->router_id));
" MPLS-TE Router-Address: %pI4\n",
&area->mta->router_id);
else
vty_out(vty, " N/A\n");
}
@ -394,11 +391,11 @@ static void show_ext_sub(struct vty *vty, char *name,
ext->remote_llri);
}
if (IS_SUBTLV(ext, EXT_LOCAL_ADDR))
sbuf_push(&buf, 4, "Local Interface IP Address(es): %s\n",
inet_ntoa(ext->local_addr));
sbuf_push(&buf, 4, "Local Interface IP Address(es): %pI4\n",
&ext->local_addr);
if (IS_SUBTLV(ext, EXT_NEIGH_ADDR))
sbuf_push(&buf, 4, "Remote Interface IP Address(es): %s\n",
inet_ntoa(ext->neigh_addr));
sbuf_push(&buf, 4, "Remote Interface IP Address(es): %pI4\n",
&ext->neigh_addr);
if (IS_SUBTLV(ext, EXT_LOCAL_ADDR6))
sbuf_push(&buf, 4, "Local Interface IPv6 Address(es): %s\n",
inet_ntop(AF_INET6, &ext->local_addr6, ibuf,
@ -432,8 +429,8 @@ static void show_ext_sub(struct vty *vty, char *name,
ext->remote_as);
if (IS_SUBTLV(ext, EXT_RMT_IP))
sbuf_push(&buf, 4,
"Inter-AS TE Remote ASBR IP address: %s\n",
inet_ntoa(ext->remote_ip));
"Inter-AS TE Remote ASBR IP address: %pI4\n",
&ext->remote_ip);
if (IS_SUBTLV(ext, EXT_DELAY))
sbuf_push(&buf, 4,
"%s Average Link Delay: %u (micro-sec)\n",

View File

@ -209,11 +209,11 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
exts->remote_llri);
}
if (IS_SUBTLV(exts, EXT_LOCAL_ADDR))
sbuf_push(buf, indent, "Local Interface IP Address(es): %s\n",
inet_ntoa(exts->local_addr));
sbuf_push(buf, indent, "Local Interface IP Address(es): %pI4\n",
&exts->local_addr);
if (IS_SUBTLV(exts, EXT_NEIGH_ADDR))
sbuf_push(buf, indent, "Remote Interface IP Address(es): %s\n",
inet_ntoa(exts->neigh_addr));
sbuf_push(buf, indent, "Remote Interface IP Address(es): %pI4\n",
&exts->neigh_addr);
if (IS_SUBTLV(exts, EXT_LOCAL_ADDR6))
sbuf_push(buf, indent, "Local Interface IPv6 Address(es): %s\n",
inet_ntop(AF_INET6, &exts->local_addr6, ibuf,
@ -247,8 +247,8 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
exts->remote_as);
if (IS_SUBTLV(exts, EXT_RMT_IP))
sbuf_push(buf, indent,
"Inter-AS TE Remote ASBR IP address: %s\n",
inet_ntoa(exts->remote_ip));
"Inter-AS TE Remote ASBR IP address: %pI4\n",
&exts->remote_ip);
/* Extended metrics */
if (IS_SUBTLV(exts, EXT_DELAY))
sbuf_push(buf, indent,