]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
TPROXY v4 support upgrade (part 1 of 2)
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 14 Apr 2008 06:30:27 +0000 (18:30 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 14 Apr 2008 06:30:27 +0000 (18:30 +1200)
Part 1 adds complete TPROXYv4 capabilities to Squid.
The alterations are rather superficially tacked into the netfilter support.

Polish for this feature involves some rather intrusive alterations to
transparency which are still undergoing testing. That is part 2.

A temporary configure option --enable-linux-tproxy4 is provided as part of
this commit to enable the TPROXY v4 code. Part 2 will remove this option
again in favour of squid.conf transparency controls.

1  2 
configure.in
src/cache_cf.cc
src/forward.cc
src/forward.h
src/http.cc
src/structs.h

diff --cc configure.in
index d74ccd7a4c08740d9ba9cc5db73a654601f467db,02da8c3dcfd61d043e48431bbfe74131d8aef1d4..857916ba0569bac4b92519ddd2ad888497cd9ba7
@@@ -1333,13 -1219,26 +1333,26 @@@ dnl "-64" from LDFLAG
  fi
  
  dnl Enable Linux transparent proxy support
 -AC_ARG_ENABLE(linux-tproxy2,
 -[  --enable-linux-tproxy2
 +AC_ARG_ENABLE(linux-tproxy,
 +[  --enable-linux-tproxy
-                         Enable real Transparent Proxy support for Netfilter TPROXY.],
+                         Enable real Transparent Proxy support for Netfilter TPROXY (version 2).],
  [ if test "$enableval" = "yes" ; then
-       echo "Linux Netfilter/TPROXY enabled"
-       AC_DEFINE(LINUX_TPROXY, 1, [Enable real Transparent Proxy support for Netfilter TPROXY.])
-       LINUX_TPROXY="yes"
+       echo "Linux Netfilter/TPROXY v2 enabled"
+       AC_DEFINE(LINUX_TPROXY2, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v2.])
+       LINUX_TPROXY2="yes"
+         if test -z "$LINUX_NETFILTER"; then
+           echo "Linux-Netfilter Transparent Proxy automatically enabled"
+           LINUX_NETFILTER="yes"
+       fi
+   fi
+ ])
+ AC_ARG_ENABLE(linux-tproxy4,
+ [  --enable-linux-tproxy4
+                         Enable real Transparent Proxy support for Netfilter TPROXY (version 4+).],
+ [ if test "$enableval" = "yes" ; then
+       echo "Linux Netfilter/TPROXY v4 enabled"
+       AC_DEFINE(LINUX_TPROXY4, 1, [Enable real Transparent Proxy support for Netfilter TPROXY v4.])
+       LINUX_TPROXY4="yes"
          if test -z "$LINUX_NETFILTER"; then
            echo "Linux-Netfilter Transparent Proxy automatically enabled"
            LINUX_NETFILTER="yes"
diff --cc src/cache_cf.cc
Simple merge
diff --cc src/forward.cc
index bdf589ceb555dd6a9e58881066a3257a4d5a4779,c86356b2eb27f2d999b691c07f614184edcf5774..d95be40ae71cfc53d188bbd0dcb2aff140fe1d4f
@@@ -879,9 -888,11 +886,8 @@@ FwdState::connectStart(
  
      commSetTimeout(fd, ctimeout, fwdConnectTimeoutWrapper, this);
  
 -    if (fs->_peer) {
 -        hierarchyNote(&request->hier, fs->code, fs->_peer->host);
 -    } else {
 -
 +    if (!fs->_peer) {
- #if LINUX_TPROXY
+ #if LINUX_TPROXY2
          if (request->flags.tproxy) {
              IPAddress addr;
  
diff --cc src/forward.h
Simple merge
diff --cc src/http.cc
Simple merge
diff --cc src/structs.h
Simple merge