From: Amos Jeffries Date: Fri, 10 Apr 2009 05:06:33 +0000 (+1200) Subject: Real quiet cache.log when TPROXY and NAT both active X-Git-Tag: SQUID_3_1_0_8~57 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc7f34be001c292f977b535b030af4e0cf02009e;p=thirdparty%2Fsquid.git Real quiet cache.log when TPROXY and NAT both active --- diff --git a/src/ip/IpIntercept.cc b/src/ip/IpIntercept.cc index a4fa9ad18e..8d104bc75c 100644 --- a/src/ip/IpIntercept.cc +++ b/src/ip/IpIntercept.cc @@ -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");