From: Dmitry V. Levin Date: Tue, 21 Jun 2016 16:44:50 +0000 (+0000) Subject: Assume that libc provides inet_ntop and inet_pton X-Git-Tag: v4.13~119 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5f1fd926ad6cc52e115c9af1d303ad1b853ad90;p=strace Assume that libc provides inet_ntop and inet_pton * 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. --- diff --git a/configure.ac b/configure.ac index 9eccde94..3aadc306 100644 --- a/configure.ac +++ b/configure.ac @@ -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 8b2c3899..9135c5b4 100644 --- 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); diff --git a/tests/ip_mreq.c b/tests/ip_mreq.c index c1d91dd9..0559b92d 100644 --- a/tests/ip_mreq.c +++ b/tests/ip_mreq.c @@ -29,7 +29,7 @@ #include #if defined IP_ADD_MEMBERSHIP && defined IPV6_ADD_MEMBERSHIP \ - && defined IPV6_JOIN_ANYCAST && defined HAVE_INET_PTON + && defined IPV6_JOIN_ANYCAST # include # include @@ -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