From: Alexander Gozman Date: Wed, 24 Oct 2018 15:28:13 +0000 (+0000) Subject: Fix client_connection_mark handling of clientless transactions (#312) X-Git-Tag: M-staged-PR314~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cad2828ea69a651733e842d0d7e6630811de3006;p=thirdparty%2Fsquid.git Fix client_connection_mark handling of clientless transactions (#312) Also affects the deprecated clientside_mark ACL. Broken since CONNMARK matching was added in commit 653d992. --- diff --git a/src/acl/ConnMark.cc b/src/acl/ConnMark.cc index 68e1d3c89f..3f43807898 100644 --- a/src/acl/ConnMark.cc +++ b/src/acl/ConnMark.cc @@ -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; }