]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Merged from trunk
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 9 Apr 2008 13:29:54 +0000 (01:29 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 9 Apr 2008 13:29:54 +0000 (01:29 +1200)
1  2 
src/forward.cc
src/forward.h

diff --cc src/forward.cc
index 124323e87c8ea08826e1b7ad7ec9b3c00a8f053d,bdf589ceb555dd6a9e58881066a3257a4d5a4779..19aa34ea9691e49b7d0b08f606ff3789e3c1a2a4
@@@ -874,23 -879,43 +872,17 @@@ 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 (request->flags.tproxy) {
 -            IPAddress addr;
 -
 -            src.GetInAddr(itp.v.addr.faddr);
 -            itp.v.addr.fport = 0;
 -
 -            /* If these syscalls fail then we just fallback to connecting
 -             * normally by simply ignoring the errors...
 -             */
 -            itp.op = TPROXY_ASSIGN;
 -
 -            addr = (struct in_addr)itp.v.addr.faddr;
 -            addr.SetPort(itp.v.addr.fport);
 -
 -            if (setsockopt(fd, SOL_IP, IP_TPROXY, &itp, sizeof(itp)) == -1) {
 -                debugs(20, 1, "tproxy ip=" << addr << " ERROR ASSIGN");
 -
 -                request->flags.tproxy = 0;
 -            } else {
 -                itp.op = TPROXY_FLAGS;
 -                itp.v.flags = ITP_CONNECT;
 -
 -                if (setsockopt(fd, SOL_IP, IP_TPROXY, &itp, sizeof(itp)) == -1) {
 -                    debugs(20, 1, "tproxy ip=" << addr << " ERROR CONNECT");
--
 -                    request->flags.tproxy = 0;
 -                }
 -            }
 +#if LINUX_TPROXY2
-         if (request->flags.spoof_client_ip) {
-             // try to set the outgoing address using TPROXY v2
-             // if it fails we abort any further TPROXY actions on this connection
-             if(IPInterceptor.SetTproxy2OutgoingAddr(int fd, const IPAddress &src) == -1) {
-                 request->flags.spoof_client_ip = 0;
-             }
++    if (!fs->_peer && request->flags.spoof_client_ip) {
++        // try to set the outgoing address using TPROXY v2
++        // if it fails we abort any further TPROXY actions on this connection
++        if(IPInterceptor.SetTproxy2OutgoingAddr(int fd, const IPAddress &src) == -1) {
++            request->flags.spoof_client_ip = 0;
          }
- #endif
--
-         hierarchyNote(&request->hier, fs->code, request->GetHost());
 -#endif
      }
++#endif
  
+     updateHierarchyInfo();
      commConnectStart(fd, host, port, fwdConnectDoneWrapper, this);
  }
  
diff --cc src/forward.h
Simple merge