]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix client_connection_mark handling of clientless transactions (#312)
authorAlexander Gozman <goal81@gmail.com>
Wed, 24 Oct 2018 15:28:13 +0000 (15:28 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 25 Oct 2018 12:31:10 +0000 (12:31 +0000)
Also affects the deprecated clientside_mark ACL.

Broken since CONNMARK matching was added in commit 653d992.

src/acl/ConnMark.cc

index 68e1d3c89ffdcc76a5c6423d9ce07cd045daf98b..3f43807898d216851334381d05d5d19eadaa1622 100644 (file)
@@ -42,15 +42,22 @@ int
 Acl::ConnMark::match(ACLChecklist *cl)
 {
     const auto *checklist = Filled(cl);
-    const auto connmark = checklist->conn()->clientConnection->nfConnmark;
+    const auto conn = checklist->conn();
 
-    for (const auto &m : marks) {
-        if (m.matches(connmark)) {
-            debugs(28, 5, "found " << m << " matching " << asHex(connmark));
-            return 1;
+    if (conn && conn->clientConnection) {
+        const auto connmark = conn->clientConnection->nfConnmark;
+
+        for (const auto &m : marks) {
+            if (m.matches(connmark)) {
+                debugs(28, 5, "found " << m << " matching " << asHex(connmark));
+                return 1;
+            }
+            debugs(28, 7, "skipped " << m << " mismatching " << asHex(connmark));
         }
-        debugs(28, 7, "skipped " << m << " mismatching " << asHex(connmark));
+    } else {
+        debugs(28, 7, "fails: no client connection");
     }
+
     return 0;
 }