]> granicus.if.org Git - strace/commitdiff
Assume that libc provides inet_ntop and inet_pton
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 21 Jun 2016 16:44:50 +0000 (16:44 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 21 Jun 2016 16:44:50 +0000 (16:44 +0000)
* configure.ac (AC_CHECK_FUNCS): Remove inet_ntop and inet_pton.
* net.c (sockaddr_buf_t, print_sockaddr, print_mreq6): Remove
HAVE_INET_NTOP checks.
* tests/ip_mreq.c: Remove HAVE_INET_PTON check.

configure.ac
net.c
tests/ip_mreq.c

index 9eccde9480988db61caacb4c760ba2fe319cbd4b..3aadc3066edd68624cabaf0c53bf76db5361dd9c 100644 (file)
@@ -290,8 +290,6 @@ AC_CHECK_FUNCS(m4_normalize([
        ftruncate
        futimens
        if_indextoname
-       inet_ntop
-       inet_pton
        pipe2
        prctl
        preadv
diff --git a/net.c b/net.c
index 8b2c3899efa5c0c4f59597854b94e4376f66cd78..9135c5b4fb6c6f4c1c5177897e99d239e7f98146 100644 (file)
--- a/net.c
+++ b/net.c
@@ -123,9 +123,7 @@ typedef union {
        struct sockaddr sa;
        struct sockaddr_in sin;
        struct sockaddr_un sau;
-#ifdef HAVE_INET_NTOP
        struct sockaddr_in6 sa6;
-#endif
        struct sockaddr_ipx sipx;
        struct sockaddr_ll ll;
        struct sockaddr_nl nl;
@@ -164,7 +162,7 @@ print_sockaddr(struct tcb *tcp, const sockaddr_buf_t *addr, const int addrlen)
                tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")",
                        ntohs(addr->sin.sin_port), inet_ntoa(addr->sin.sin_addr));
                break;
-#ifdef HAVE_INET_NTOP
+
        case AF_INET6:
                {
                        char string_addr[100];
@@ -174,19 +172,18 @@ print_sockaddr(struct tcb *tcp, const sockaddr_buf_t *addr, const int addrlen)
                                ", \"%s\", &sin6_addr), sin6_flowinfo=%u",
                                ntohs(addr->sa6.sin6_port), string_addr,
                                addr->sa6.sin6_flowinfo);
-# ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
+#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
                        tprints(", sin6_scope_id=");
-#  if defined IN6_IS_ADDR_LINKLOCAL && defined IN6_IS_ADDR_MC_LINKLOCAL
+# if defined IN6_IS_ADDR_LINKLOCAL && defined IN6_IS_ADDR_MC_LINKLOCAL
                        if (IN6_IS_ADDR_LINKLOCAL(&addr->sa6.sin6_addr)
                            || IN6_IS_ADDR_MC_LINKLOCAL(&addr->sa6.sin6_addr))
                                print_ifindex(addr->sa6.sin6_scope_id);
                        else
-#  endif
+# endif
                                tprintf("%u", addr->sa6.sin6_scope_id);
-# endif /* HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID */
+#endif /* HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID */
                }
                break;
-#endif
 
        case AF_IPX:
                {
@@ -1345,7 +1342,6 @@ print_mreq6(struct tcb *tcp, long addr, unsigned int len)
        if (umove_or_printaddr(tcp, addr, &mreq))
                return;
 
-#ifdef HAVE_INET_NTOP
        const struct in6_addr *in6 = &mreq.ipv6mr_multiaddr;
        char address[INET6_ADDRSTRLEN];
 
@@ -1358,7 +1354,6 @@ print_mreq6(struct tcb *tcp, long addr, unsigned int len)
        print_ifindex(mreq.ipv6mr_interface);
        tprints("}");
        return;
-#endif /* HAVE_INET_NTOP */
 
 fail:
        printstr(tcp, addr, len);
index c1d91dd91cd54d474493a728c1bad0ab495dce42..0559b92dd5aa06e1b263c350e489fd599e6f88f8 100644 (file)
@@ -29,7 +29,7 @@
 #include <netinet/in.h>
 
 #if defined IP_ADD_MEMBERSHIP && defined IPV6_ADD_MEMBERSHIP \
- && defined IPV6_JOIN_ANYCAST && defined HAVE_INET_PTON
+ && defined IPV6_JOIN_ANYCAST
 
 # include <assert.h>
 # include <unistd.h>
@@ -73,6 +73,6 @@ main(void)
 #else
 
 SKIP_MAIN_UNDEFINED("IP_ADD_MEMBERSHIP && IPV6_ADD_MEMBERSHIP"
-                   " && IPV6_JOIN_ANYCAST && HAVE_INET_PTON")
+                   " && IPV6_JOIN_ANYCAST")
 
 #endif