From: Francesco Chemolli Date: Thu, 22 Apr 2010 14:31:32 +0000 (+0200) Subject: Improved handling of PF-based transparent proxy option. Now defaults to "auto" X-Git-Tag: SQUID_3_2_0_1~271^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d26e25223d91b7ff70a49b8185f5bc7a83c4361;p=thirdparty%2Fsquid.git Improved handling of PF-based transparent proxy option. Now defaults to "auto" --- diff --git a/configure.in b/configure.in index 694a111838..658455a874 100644 --- a/configure.in +++ b/configure.in @@ -1268,27 +1268,26 @@ SQUID_DEFINE_UNQUOTED(HTTP_VIOLATIONS, ${enable_http_violations:=yes}, AC_MSG_NOTICE([HTTP violations support enabled: $enable_http_violations]) # IPFW Transparent Proxy -squid_opt_enable_ipfw_transparent="no" AC_ARG_ENABLE(ipfw-transparent, - AS_HELP_STRING([--enable-ipfw-transparent],[Enable Transparent Proxy support for systems + AS_HELP_STRING([--enable-ipfw-transparent], + [Enable Transparent Proxy support for systems using FreeBSD IPFW-style firewalling.]), [ - SQUID_YESNO([$enableval],[unrecognized argument to --enable-ipfw-transparent: $enableval]) - squid_opt_enable_ipfw_transparent=$enableval + SQUID_YESNO([$enableval], + [unrecognized argument to --enable-ipfw-transparent: $enableval]) ]) -SQUID_DEFINE_UNQUOTED(IPFW_TRANSPARENT,$squid_opt_enable_ipfw_transparent, +SQUID_DEFINE_UNQUOTED(IPFW_TRANSPARENT,${enable_ipfw_transparent:=no}, [Enable support for Transparent Proxy on systems using FreeBSD IPFW-style firewalling.]) +AC_MSG_NOTICE([FreeBSD IPFW-based transparent proxying enabled: $enable_ipfw_transparent]) # IP-Filter Transparent Proxy -AH_TEMPLATE(IPF_TRANSPARENT, - [Enable support for Transparent Proxy on systems using IPF-style firewalling]) -squid_opt_ipf_transparent=no AC_ARG_ENABLE(ipf-transparent, AS_HELP_STRING([--enable-ipf-transparent], - [Enable Transparent Proxy support for OSes using IPFilter-style firewalling]), [ - SQUID_YESNO([$enableval],[unrecognized argument to --enable-ipf-transparent: $enableval]) - squid_opt_ipf_transparent=$enableval - #will be AC_DEFINE'd and MSG'ed later, after checking for appropriate infrastructure + [Enable Transparent Proxy support using IPFilter-style firewalling]), [ + SQUID_YESNO([$enableval], + [unrecognized argument to --enable-ipf-transparent: $enableval]) ]) +#will be AC_DEFINE'd later, after checking for appropriate infrastructure +AC_MSG_NOTICE([IPF-based transparent proxying requested: ${enable_ipf_transparent:=auto}]) dnl Enable PF Transparent Proxy AH_TEMPLATE(PF_TRANSPARENT, @@ -1296,14 +1295,11 @@ AH_TEMPLATE(PF_TRANSPARENT, AC_ARG_ENABLE(pf-transparent, AS_HELP_STRING([--enable-pf-transparent], [Enable Transparent Proxy support for systems using PF network address redirection.]), [ - SQUID_YESNO([$enableval],[unrecognized argument to --enable-pf-transparent: $enableval]) - squid_opt_pf_transparent=$enableval - if test "$enableval" = "yes" ; then - AC_MSG_NOTICE([PF Transparent Proxy enabled]) - squid_opt_pf_transparent="yes" - #will be AC_DEFINE'd later, after checking for appropriate infrastructure - fi + SQUID_YESNO([$enableval], + [unrecognized argument to --enable-pf-transparent: $enableval]) ]) +#will be AC_DEFINE'd later, after checking for appropriate infrastructure +AC_MSG_NOTICE([PF-based transparent proxying enabled: ${enable_pf_transparent:=no}]) # Enable Linux Netfilter Transparent Proxy squid_opt_linux_netfilter="auto" @@ -3145,8 +3141,7 @@ SQUID_CHECK_FUNC___VACOPY dnl IP-Filter support requires ipf header files. These aren't dnl installed by default, so we need to check for them -AC_MSG_NOTICE([Support for IPF-based transparent proxy requested: $squid_opt_ipf_transparent]) -if test "$squid_opt_ipf_transparent" != "no" ; then +if test "$enable_ipf_transparent" != "no" ; then AC_MSG_CHECKING(for availability of IP-Filter header files) # hold on to your hats... if test "$ac_cv_header_ip_compat_h" = "yes" || @@ -3158,20 +3153,22 @@ if test "$squid_opt_ipf_transparent" != "no" ; then if test "$have_ipfilter_compat_header" = "yes" && test "$ac_cv_header_ip_fil_h" = "yes" && test "$ac_cv_header_ip_nat_h" = "yes" ; then - squid_opt_ipf_transparent="yes" - AC_DEFINE(IPF_TRANSPARENT, 1) + enable_ipf_transparent="yes" elif test "$have_ipfilter_compat_header" = "yes" && test "$ac_cv_header_netinet_ip_fil_h" = "yes" && test "$ac_cv_header_netinet_ip_nat_h" = "yes" ; then - squid_opt_ipf_transparent="yes" - AC_DEFINE(IPF_TRANSPARENT, 1) + enable_ipf_transparent="yes" else - squid_opt_ipf_transparent="no" + enable_ipf_transparent="no" AC_DEFINE(IPF_TRANSPARENT, 0) fi AC_MSG_RESULT($IPF_TRANSPARENT) -fi -if test "$squid_opt_ipf_transparent" = "yes" -a "$squid_host_os" = "solaris" ; then +fi +AC_MSG_NOTICE([IPF-based transparent proxying enabled: $enable_ipf_transparent]) +SQUID_DEFINE_UNQUOTED([IPF_TRANSPARENT],$enable_ipf_transparent, + [Enable support for IPF-style transparent proxying]) + +if test "$enable_ipf_transparent" = "yes" -a "$squid_host_os" = "solaris" ; then dnl On Solaris Ipfilter includes expect that SOLARIS2 is defined with the dnl Solaris minor version (8, 9, 10, ...) solrev=`uname -r | sh -c 'IFS=. read j n x; echo $n'` @@ -3180,20 +3177,20 @@ dnl Solaris minor version (8, 9, 10, ...) fi dnl PF support requires a header file. -AC_MSG_NOTICE([Support for PF-based transparent proxy requested: $squid_opt_pf_transparent]) -if test "$squid_opt_pf_transparent" != "no" ; then +AC_MSG_NOTICE([Support for PF-based transparent proxy requested: $enable_pf_transparent]) +if test "$enable_pf_transparent" != "no" ; then AC_MSG_CHECKING(for availability of PF header files) # hold on to your hats... if test "$ac_cv_header_net_pfvar_h" = "yes" || test "$ac_cv_header_net_pf_pfvar_h" = "yes"; then - squid_opt_pf_transparent="yes" + enable_pf_transparent="yes" AC_DEFINE(PF_TRANSPARENT, 1) else - squid_opt_pf_transparent="no" + enable_pf_transparent="no" AC_DEFINE(PF_TRANSPARENT, 0) fi - AC_MSG_RESULT($squid_opt_pf_transparent) + AC_MSG_RESULT($enable_pf_transparent) fi -if test "$squid_opt_pf_transparent" = "no" ; then +if test "$enable_pf_transparent" = "no" ; then AC_MSG_WARN([Cannot find necessary PF header file]) AC_MSG_WARN([Transparent Proxy support WILL NOT be enabled]) fi