]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: replace inet_ntoa 7372/head
authorMark Stapp <mjs@voltanet.io>
Thu, 22 Oct 2020 18:30:34 +0000 (14:30 -0400)
committerMark Stapp <mjs@voltanet.io>
Thu, 22 Oct 2020 20:25:41 +0000 (16:25 -0400)
Replace use of inet_ntoa, using pI4

Signed-off-by: Mark Stapp <mjs@voltanet.io>
isisd/isis_adjacency.c
isisd/isis_te.c
isisd/isis_tlvs.c

index 5bfbb2cf7e66fc5ca9a4564802ae3c7edae92054..59403b6c236318bb72f11642d8df075126eaa649 100644 (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");
index 87c44281558b31dcf8944adac98add6099d77e98..8daa2b36bfb3629bcff468368744e43ba5f5efcd 100644 (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",
index a1f9cc236ff75d4df146c99dca7d822410a7d333..c1603d2ef07a3d382173182df57a75de27141d9d 100644 (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,