]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Real quiet cache.log when TPROXY and NAT both active
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 6 Apr 2009 13:33:04 +0000 (01:33 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 6 Apr 2009 13:33:04 +0000 (01:33 +1200)
src/ip/IpIntercept.cc

index 1ff03d4e7f38e1e58b1e42f710f6192e6a8bc70f..a7ff6fe40cd1e4527bdd7f7787142be888d7f654 100644 (file)
@@ -378,6 +378,11 @@ IpIntercept::NatLookup(int fd, const IpAddress &me, const IpAddress &peer, IpAdd
     debugs(89, 5, HERE << "address BEGIN: me= " << me << ", client= " << client <<
            ", dst= " << dst << ", peer= " << peer);
 
+    /* NP: try TPROXY first, its much quieter than NAT when non-matching */
+    if (transparent_active) {
+        if ( NetfilterTransparent(fd, me, dst, silent) == 0) return 0;
+    }
+
     if (intercept_active) {
         /* NAT methods that use sock-opts to return client address */
         if ( NetfilterInterception(fd, me, client, silent) == 0) return 0;
@@ -387,9 +392,6 @@ IpIntercept::NatLookup(int fd, const IpAddress &me, const IpAddress &peer, IpAdd
         if ( PfInterception(fd, me, client, dst, silent) == 0) return 0;
         if ( IpfInterception(fd, me, client, dst, silent) == 0) return 0;
     }
-    if (transparent_active) {
-        if ( NetfilterTransparent(fd, me, dst, silent) == 0) return 0;
-    }
 
 #else /* none of the transparent options configured */
     debugs(89, DBG_IMPORTANT, "WARNING: transparent proxying not supported");