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:
parent
f8ed94b53a
commit
b5f1fd926a
@ -290,8 +290,6 @@ AC_CHECK_FUNCS(m4_normalize([
|
||||
ftruncate
|
||||
futimens
|
||||
if_indextoname
|
||||
inet_ntop
|
||||
inet_pton
|
||||
pipe2
|
||||
prctl
|
||||
preadv
|
||||
|
15
net.c
15
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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user