]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3723: tcp_outgoing_tos/mark broken for CONNECT requests
authorSebastien Wenske <sebastien@wenske.fr>
Sat, 9 Feb 2013 06:40:29 +0000 (23:40 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 9 Feb 2013 06:40:29 +0000 (23:40 -0700)
src/tunnel.cc

index aa82ebee50337997d6cb0aa3fd681caf52647382..f799f177f06c6e959770b1f116ee2a07967186b1 100644 (file)
@@ -50,6 +50,7 @@
 #include "client_side.h"
 #include "MemBuf.h"
 #include "http.h"
+#include "ip/QosConfig.h"
 #include "PeerSelectState.h"
 #include "StatCounters.h"
 
@@ -558,6 +559,15 @@ tunnelConnectDone(const Comm::ConnectionPointer &conn, comm_err_t status, int xe
         tunnelState->serverDestinations.shift();
         if (status != COMM_TIMEOUT && tunnelState->serverDestinations.size() > 0) {
             /* Try another IP of this destination host */
+
+            if (Ip::Qos::TheConfig.isAclTosActive()) {
+                tunnelState->serverDestinations[0]->tos = GetTosToServer(tunnelState->request);
+            }
+
+#if SO_MARK && USE_LIBCAP
+            tunnelState->serverDestinations[0]->nfmark = GetNfmarkToServer(tunnelState->request);
+#endif
+
             debugs(26, 4, HERE << "retry with : " << tunnelState->serverDestinations[0]);
             AsyncCall::Pointer call = commCbCall(26,3, "tunnelConnectDone", CommConnectCbPtrFun(tunnelConnectDone, tunnelState));
             Comm::ConnOpener *cs = new Comm::ConnOpener(tunnelState->serverDestinations[0], call, Config.Timeout.connect);
@@ -724,6 +734,14 @@ tunnelPeerSelectComplete(Comm::ConnectionList *peer_paths, ErrorState *err, void
     }
     delete err;
 
+    if (Ip::Qos::TheConfig.isAclTosActive()) {
+        tunnelState->serverDestinations[0]->tos = GetTosToServer(tunnelState->request);
+    }
+
+#if SO_MARK && USE_LIBCAP
+    tunnelState->serverDestinations[0]->nfmark = GetNfmarkToServer(tunnelState->request);
+#endif
+
     debugs(26, 3, HERE << "paths=" << peer_paths->size() << ", p[0]={" << (*peer_paths)[0] << "}, serverDest[0]={" <<
            tunnelState->serverDestinations[0] << "}");