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) { if (adj->ipv4_address_count) {
zlog_debug("IPv4 Address(es):"); zlog_debug("IPv4 Address(es):");
for (unsigned int i = 0; i < adj->ipv4_address_count; i++) 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) { 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"); vty_out(vty, " IPv4 Address(es):\n");
for (unsigned int i = 0; i < adj->ipv4_address_count; for (unsigned int i = 0; i < adj->ipv4_address_count;
i++) i++)
vty_out(vty, " %s\n", vty_out(vty, " %pI4\n",
inet_ntoa(adj->ipv4_addresses[i])); &adj->ipv4_addresses[i]);
} }
if (adj->ipv6_address_count) { if (adj->ipv6_address_count) {
vty_out(vty, " IPv6 Address(es):\n"); 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) if (ntohs(area->mta->router_id.s_addr)
!= 0) != 0)
vty_out(vty, vty_out(vty,
" MPLS-TE Router-Address: %s\n", " MPLS-TE Router-Address: %pI4\n",
inet_ntoa( &area->mta->router_id);
area->mta
->router_id));
else else
vty_out(vty, " N/A\n"); 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); vty_out(vty, "Area %s:\n", area->area_tag);
if (ntohs(area->mta->router_id.s_addr) != 0) if (ntohs(area->mta->router_id.s_addr) != 0)
vty_out(vty, vty_out(vty,
" MPLS-TE Router-Address: %s\n", " MPLS-TE Router-Address: %pI4\n",
inet_ntoa( &area->mta->router_id);
area->mta->router_id));
else else
vty_out(vty, " N/A\n"); vty_out(vty, " N/A\n");
} }
@ -394,11 +391,11 @@ static void show_ext_sub(struct vty *vty, char *name,
ext->remote_llri); ext->remote_llri);
} }
if (IS_SUBTLV(ext, EXT_LOCAL_ADDR)) if (IS_SUBTLV(ext, EXT_LOCAL_ADDR))
sbuf_push(&buf, 4, "Local Interface IP Address(es): %s\n", sbuf_push(&buf, 4, "Local Interface IP Address(es): %pI4\n",
inet_ntoa(ext->local_addr)); &ext->local_addr);
if (IS_SUBTLV(ext, EXT_NEIGH_ADDR)) if (IS_SUBTLV(ext, EXT_NEIGH_ADDR))
sbuf_push(&buf, 4, "Remote Interface IP Address(es): %s\n", sbuf_push(&buf, 4, "Remote Interface IP Address(es): %pI4\n",
inet_ntoa(ext->neigh_addr)); &ext->neigh_addr);
if (IS_SUBTLV(ext, EXT_LOCAL_ADDR6)) if (IS_SUBTLV(ext, EXT_LOCAL_ADDR6))
sbuf_push(&buf, 4, "Local Interface IPv6 Address(es): %s\n", sbuf_push(&buf, 4, "Local Interface IPv6 Address(es): %s\n",
inet_ntop(AF_INET6, &ext->local_addr6, ibuf, 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); ext->remote_as);
if (IS_SUBTLV(ext, EXT_RMT_IP)) if (IS_SUBTLV(ext, EXT_RMT_IP))
sbuf_push(&buf, 4, sbuf_push(&buf, 4,
"Inter-AS TE Remote ASBR IP address: %s\n", "Inter-AS TE Remote ASBR IP address: %pI4\n",
inet_ntoa(ext->remote_ip)); &ext->remote_ip);
if (IS_SUBTLV(ext, EXT_DELAY)) if (IS_SUBTLV(ext, EXT_DELAY))
sbuf_push(&buf, 4, sbuf_push(&buf, 4,
"%s Average Link Delay: %u (micro-sec)\n", "%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); exts->remote_llri);
} }
if (IS_SUBTLV(exts, EXT_LOCAL_ADDR)) if (IS_SUBTLV(exts, EXT_LOCAL_ADDR))
sbuf_push(buf, indent, "Local Interface IP Address(es): %s\n", sbuf_push(buf, indent, "Local Interface IP Address(es): %pI4\n",
inet_ntoa(exts->local_addr)); &exts->local_addr);
if (IS_SUBTLV(exts, EXT_NEIGH_ADDR)) if (IS_SUBTLV(exts, EXT_NEIGH_ADDR))
sbuf_push(buf, indent, "Remote Interface IP Address(es): %s\n", sbuf_push(buf, indent, "Remote Interface IP Address(es): %pI4\n",
inet_ntoa(exts->neigh_addr)); &exts->neigh_addr);
if (IS_SUBTLV(exts, EXT_LOCAL_ADDR6)) if (IS_SUBTLV(exts, EXT_LOCAL_ADDR6))
sbuf_push(buf, indent, "Local Interface IPv6 Address(es): %s\n", sbuf_push(buf, indent, "Local Interface IPv6 Address(es): %s\n",
inet_ntop(AF_INET6, &exts->local_addr6, ibuf, 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); exts->remote_as);
if (IS_SUBTLV(exts, EXT_RMT_IP)) if (IS_SUBTLV(exts, EXT_RMT_IP))
sbuf_push(buf, indent, sbuf_push(buf, indent,
"Inter-AS TE Remote ASBR IP address: %s\n", "Inter-AS TE Remote ASBR IP address: %pI4\n",
inet_ntoa(exts->remote_ip)); &exts->remote_ip);
/* Extended metrics */ /* Extended metrics */
if (IS_SUBTLV(exts, EXT_DELAY)) if (IS_SUBTLV(exts, EXT_DELAY))
sbuf_push(buf, indent, sbuf_push(buf, indent,