]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not stop listening after "ERROR: NAT/TPROXY lookup failed..." (#837)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sat, 12 Feb 2022 05:56:46 +0000 (05:56 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 17 Feb 2022 03:49:08 +0000 (03:49 +0000)
_Intermittent_ NAT/TPROXY lookup failures can happen for several reasons
outside Squid control. For example, flushing conntrack tables under load
is likely to trigger such errors. Squid should not stop listening if
there is a good change that the next accept(2) will be fully successful.
We already apply the same logic to several other accept problems today.

Also added an XXX that TcpAcceptor::mustStop() does not work as expected
on error.

src/comm/TcpAcceptor.cc

index 73ab12c5c928e05bd46f5f456cb45b29f2eb45c7..8aa57a9d1e02c3a51b5e8d7ba23f953629b6a908 100644 (file)
@@ -282,6 +282,7 @@ Comm::TcpAcceptor::acceptOne()
         if (intendedForUserConnections())
             logAcceptError(newConnDetails);
         notify(flag, newConnDetails);
+        // XXX: not under async job call protections
         mustStop("Listener socket closed");
         return;
     }
@@ -394,8 +395,7 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details)
     // Perform NAT or TPROXY operations to retrieve the real client/dest IP addresses
     if (conn->flags&(COMM_TRANSPARENT|COMM_INTERCEPTION) && !Ip::Interceptor.Lookup(details, conn)) {
         debugs(50, DBG_IMPORTANT, "ERROR: NAT/TPROXY lookup failed to locate original IPs on " << details);
-        // Failed.
-        return Comm::COMM_ERROR;
+        return Comm::NOMESSAGE;
     }
 
 #if USE_SQUID_EUI