]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix false NAT lookup errors.
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 31 May 2009 00:32:47 +0000 (12:32 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 31 May 2009 00:32:47 +0000 (12:32 +1200)
Turns out the getsockopt result test was inverted.
Also update SOL_IP parameter to current IPPROTO values.

src/ip/IpIntercept.cc

index dffdea90087dd9d38897be4ee2d0eac333bbe47d..cdb8f01c346ed02619a529ee67dd83742a854c0b 100644 (file)
@@ -132,7 +132,7 @@ IpIntercept::NetfilterInterception(int fd, const IpAddress &me, IpAddress &dst,
 
     /** \par
      * Try NAT lookup for REDIRECT or DNAT targets. */
-    if ( getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, lookup->ai_addr, &lookup->ai_addrlen) == 0) {
+    if ( getsockopt(fd, IPPROTO_IP, SO_ORIGINAL_DST, lookup->ai_addr, &lookup->ai_addrlen) != 0) {
         if (!silent) {
             debugs(89, DBG_IMPORTANT, HERE << " NF getsockopt(SO_ORIGINAL_DST) failed on FD " << fd << ": " << xstrerror());
             last_reported = squid_curtime;