From: Amos Jeffries Date: Fri, 20 Jun 2008 12:41:29 +0000 (-0600) Subject: Netfilter headers not detected properly. X-Git-Tag: SQUID_3_0_STABLE7~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6045f51832ee340d09d4c439cabf4f06636c8803;p=thirdparty%2Fsquid.git Netfilter headers not detected properly. ip(6)tables v1.4.0 was released with a small bug in its header dependency. This caused our configure checks for its usability to fail. Also a mismatch between the code #if .. #endif and configure definitions caused some pre-compiler logic failures on GCC 4.3. This fixes both issues and makes Squid operable again when built against Netfilter xtables v1.4.0 --- diff --git a/configure b/configure index 9da9143849..38e3a5cc3a 100755 --- a/configure +++ b/configure @@ -22021,6 +22021,12 @@ cat >>confdefs.h <<\_ACEOF _ACEOF IPFW_TRANSPARENT="yes" + else + +cat >>confdefs.h <<\_ACEOF +#define IPFW_TRANSPARENT 0 +_ACEOF + fi fi @@ -22036,6 +22042,12 @@ cat >>confdefs.h <<\_ACEOF _ACEOF IPF_TRANSPARENT="yes" + else + +cat >>confdefs.h <<\_ACEOF +#define IPF_TRANSPARENT 0 +_ACEOF + fi fi @@ -22051,6 +22063,12 @@ cat >>confdefs.h <<\_ACEOF _ACEOF PF_TRANSPARENT="yes" + else + +cat >>confdefs.h <<\_ACEOF +#define PF_TRANSPARENT 0 +_ACEOF + fi fi @@ -22066,6 +22084,12 @@ cat >>confdefs.h <<\_ACEOF _ACEOF LINUX_NETFILTER="yes" + else + +cat >>confdefs.h <<\_ACEOF +#define LINUX_NETFILTER 0 +_ACEOF + fi fi @@ -22166,6 +22190,12 @@ _ACEOF echo "Linux-Netfilter Transparent Proxy automatically enabled" LINUX_NETFILTER="yes" fi + else + +cat >>confdefs.h <<\_ACEOF +#define LINUX_TPROXY2 0 +_ACEOF + fi fi @@ -24511,6 +24541,10 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_LIMITS_H #include #endif +/* Netfilter ip(6)tables v1.4.0 has broken headers */ +#if HAVE_NETINET_IN_H +#include +#endif #include <$ac_header> diff --git a/configure.in b/configure.in index b9675e0dd1..0ffdca7029 100755 --- a/configure.in +++ b/configure.in @@ -1091,6 +1091,8 @@ AC_ARG_ENABLE(ipfw-transparent, echo "IPFW Transparent Proxy enabled" AC_DEFINE(IPFW_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.]) IPFW_TRANSPARENT="yes" + else + AC_DEFINE(IPFW_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using FreeBSD IPFW address redirection.]) fi ]) @@ -1103,6 +1105,8 @@ AC_ARG_ENABLE(ipf-transparent, echo "IP-Filter Transparent Proxy enabled" AC_DEFINE(IPF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.]) IPF_TRANSPARENT="yes" + else + AC_DEFINE(IPF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system.]) fi ]) @@ -1115,6 +1119,8 @@ AC_ARG_ENABLE(pf-transparent, echo "PF Transparent Proxy enabled" AC_DEFINE(PF_TRANSPARENT,1,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.]) PF_TRANSPARENT="yes" + else + AC_DEFINE(PF_TRANSPARENT,0,[Enable support for Transparent Proxy on systems using PF address redirection. This provides "masquerading" support for OpenBSD.]) fi ]) @@ -1126,6 +1132,8 @@ AC_ARG_ENABLE(linux-netfilter, echo "Linux (Netfilter) Transparent Proxy enabled" AC_DEFINE(LINUX_NETFILTER,1,[Enable support for Transparent Proxy on Linux (Netfilter) systems]) LINUX_NETFILTER="yes" + else + AC_DEFINE(LINUX_NETFILTER,0,[Enable support for Transparent Proxy on Linux (Netfilter) systems]) fi ]) @@ -1239,6 +1247,8 @@ AC_ARG_ENABLE(linux-tproxy, echo "Linux-Netfilter Transparent Proxy automatically enabled" LINUX_NETFILTER="yes" fi + else + AC_DEFINE(LINUX_TPROXY2, 0, [Enable real Transparent Proxy support for Netfilter TPROXY v2.]) fi ]) @@ -1929,6 +1939,10 @@ SQUID_DEFAULT_INCLUDES #if HAVE_LIMITS_H #include #endif +/* Netfilter ip(6)tables v1.4.0 has broken headers */ +#if HAVE_NETINET_IN_H +#include +#endif ) dnl *BSD dont include the depenencies for all their net/ and netinet/ files diff --git a/include/autoconf.h.in b/include/autoconf.h.in index bccbcb9f8d..5982747979 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -775,6 +775,9 @@ /* Enable real Transparent Proxy support for Netfilter TPROXY. */ #undef LINUX_TPROXY +/* Enable real Transparent Proxy support for Netfilter TPROXY v2. */ +#undef LINUX_TPROXY2 + /* If we need to declare sys_errlist[] as external */ #undef NEED_SYS_ERRLIST