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.
This commit is contained in:
Дмитрий Левин 2016-06-21 16:44:50 +00:00
parent f8ed94b53a
commit b5f1fd926a
3 changed files with 7 additions and 14 deletions

View File

@ -290,8 +290,6 @@ AC_CHECK_FUNCS(m4_normalize([
ftruncate
futimens
if_indextoname
inet_ntop
inet_pton
pipe2
prctl
preadv

7
net.c
View File

@ -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];
@ -186,7 +184,6 @@ print_sockaddr(struct tcb *tcp, const sockaddr_buf_t *addr, const int addrlen)
#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);

View 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