mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-24 02:23:27 +08:00
Check for compiling for IPv6; don't check whether we can create an IPv6 socket.
Don't check whether we can create a TCP-over-IPv6 socket; that appears to fail in some cases where tcpdump can be built with IPv6 support. Instead, just check whether AF_INET6 and struct in6_addr are defined.
This commit is contained in:
parent
35d9d59de0
commit
5f357be7ac
30
configure
vendored
30
configure
vendored
@ -4833,28 +4833,27 @@ $as_echo "no" >&6; }
|
||||
ipv6=no
|
||||
;;
|
||||
esac
|
||||
else
|
||||
if test "$cross_compiling" = yes; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
ipv6=no
|
||||
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
/* AF_INET6 available check */
|
||||
|
||||
/* AF_INET6 available check */
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
main()
|
||||
#include <netinet/in.h>
|
||||
#ifdef AF_INET6
|
||||
void
|
||||
foo(struct in6_addr *addr)
|
||||
{
|
||||
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
|
||||
exit(1);
|
||||
else
|
||||
exit(0);
|
||||
memset(addr, 0, sizeof (struct in6_addr));
|
||||
}
|
||||
#else
|
||||
#error "AF_INET6 not defined"
|
||||
#endif
|
||||
|
||||
|
||||
_ACEOF
|
||||
if ac_fn_c_try_run "$LINENO"; then :
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
|
||||
@ -4867,10 +4866,7 @@ else
|
||||
$as_echo "no" >&6; }
|
||||
ipv6=no
|
||||
fi
|
||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
||||
conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
|
||||
|
21
configure.in
21
configure.in
@ -221,17 +221,24 @@ yes) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
|
||||
AC_TRY_RUN([ /* AF_INET6 available check */
|
||||
AC_COMPILE_IFELSE(
|
||||
[
|
||||
AC_LANG_SOURCE(
|
||||
[[/* AF_INET6 available check */
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
main()
|
||||
#include <netinet/in.h>
|
||||
#ifdef AF_INET6
|
||||
void
|
||||
foo(struct in6_addr *addr)
|
||||
{
|
||||
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
|
||||
exit(1);
|
||||
else
|
||||
exit(0);
|
||||
memset(addr, 0, sizeof (struct in6_addr));
|
||||
}
|
||||
],
|
||||
#else
|
||||
#error "AF_INET6 not defined"
|
||||
#endif
|
||||
]])
|
||||
],
|
||||
[ AC_MSG_RESULT(yes)
|
||||
LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
|
||||
AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
|
||||
|
Loading…
Reference in New Issue
Block a user