From ef410bf00a5b1e36dada75127dd525cd377a4756 Mon Sep 17 00:00:00 2001 From: Nicolas Dichtel Date: Tue, 30 May 2017 09:56:26 +0200 Subject: conntrackd: remove use of HAVE_INET_PTON_IPV6 The goal of this patch is to fix the ipv6 support when conntrackd is cross-compiled. The AC_RUN_IFELSE macro must be avoided as much as possible. See section 6.6 of the gnu autoconf: "If you really need to test for a runtime behavior while configuring, you can write a test program to determine the result, and compile and run it using AC_RUN_IFELSE. Avoid running test programs if possible, because this prevents people from configuring your package for cross-compiling." Let's remove this check and test the returned error to handle the case where ipv6 is not supported (inet_pton() returns -1 when the family is not supported). Reported-by: Zhenlin Zhang Signed-off-by: Nicolas Dichtel Signed-off-by: Pablo Neira Ayuso --- configure.ac | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 6141220..ba330ee 100644 --- a/configure.ac +++ b/configure.ac @@ -81,34 +81,6 @@ dnl AC_CHECK_LIB([c], [main]) AC_CHECK_HEADERS(arpa/inet.h) dnl check for inet_pton AC_CHECK_FUNCS(inet_pton) -dnl Some systems have it, but not IPv6 -if test "$ac_cv_func_inet_pton" = "yes" ; then -AC_MSG_CHECKING(if inet_pton supports IPv6) -AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_ARPA_INET_H -#include -#endif -int main() - { - struct in6_addr addr6; - if (inet_pton(AF_INET6, "::1", &addr6) < 1) - exit(1); - else - exit(0); - } - ]])],[ AC_MSG_RESULT(yes) - AC_DEFINE_UNQUOTED(HAVE_INET_PTON_IPV6, 1, [Define to 1 if inet_pton supports IPv6.]) - ],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)]) -fi # Checks for header files. dnl AC_HEADER_STDC -- cgit v1.2.3