From nobody Thu Jul 3 12:01:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXwMw5cRlz60qxw; Thu, 03 Jul 2025 12:01:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bXwMw2qzhz3n2v; Thu, 03 Jul 2025 12:01:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751544076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w1sKeGK/W/HeqzrjLvFM5rw03DKaxNfH/GRHg3dUt7M=; b=WG1jnQ6i5DcitOLoJ0KuIJOiU5RBg5GQ7h/oSRMIOnk1m9hkjktfg+mL5njX3CNQ3wcC1l zGeUIHMYpB0/hhI6rv2e6zBNZ3x0F6AijREntksjfsy4Ix0pi5w2P2lepeEwK/dzfZ8rqk wlMUX7dRQ7W/vdwD0Yd+FcgTc3DDH+ri+UyBxT7i7B59wpzYAGbUyqlTUUvp8/F21cEYk7 j6hKH+NrrFxvPdY9+ZwqYfXK8rcV5wxxWii1hnP6cZ9zWhzlXfMQG5yo+GRK9peAg8Wzoy l5ny8nVjX73srxt7dD4xPi0xoikZqEqcz1mXrLDjwwDPgDKeGeTVXlkHyVldLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751544076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w1sKeGK/W/HeqzrjLvFM5rw03DKaxNfH/GRHg3dUt7M=; b=AlfEUcDyBw5bVnsOfHE8aS7CW2qZM94jFUiwlAEyBsnsAyDFAEcsShOH7hZCVIBYsO9vcB yrSWn7VAHfFTjA8ge7O6c2sQoAG7n4nhLASRbBFn40pIOXTQmbGfVmdZLyRqIJpOrPKXNa 2MIApd+drzdpRPTsTtBr8S2scMHQoZWWD6mGT3MuZaSkvdfnCPz+PSqhoCw1efhGn1RIpc Nfkj4GEwovU94s3UpczRcGVn2aAAL3yg8bU/TDWbEr9YGhUuJWT08H+RX9mqOkSiVPCrK2 wxgvSvNKM5tZFXhoB98dVTwC34T6pCA4YohKA3S73f7Tdf2uEM3+Ud+f2/oT1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751544076; a=rsa-sha256; cv=none; b=WsVfX62fDMqVmg06R9K0u/SVD+3oL2iBpU4H0JKd4qYRlrb9yFBIuKqAUGwOeHOGtS6Z99 TZs24Lv1H7ud+cGG6RlPdi2/+oGqdwJ87CHm79SR51SDy+rzEqZGRGq1BYeK6yOQzkvrUV /m4dZk2gSdFpnxuKnkELptzgfQBlPF10/M7dWeHJ/NMsf91uXu7LBoEv4NEbkrrrbuV5mF OEbyI95T6UCvyw1TQfTQbEKsxsHM/zK5NrC9Bw3RL28Bs3hmb8IOzXPjE33OnCS2+L9nRa EWQdRB5GSlqRWXlQ2vnSyIjUq7Q4kGkPhGN5AR0OGBlHKKV9F2k/l5OklrNWPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bXwMw2P6Fz13rx; Thu, 03 Jul 2025 12:01:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 563C1GIH052211; Thu, 3 Jul 2025 12:01:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 563C1GJt052208; Thu, 3 Jul 2025 12:01:16 GMT (envelope-from git) Date: Thu, 3 Jul 2025 12:01:16 GMT Message-Id: <202507031201.563C1GJt052208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: fe20818673aa - main - pf: Honor quick on anchor rules List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe20818673aa9fa33c1abe6262a6f3fc0ef7a5e9 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=fe20818673aa9fa33c1abe6262a6f3fc0ef7a5e9 commit fe20818673aa9fa33c1abe6262a6f3fc0ef7a5e9 Author: Kristof Provost AuthorDate: 2025-06-30 09:45:36 +0000 Commit: Kristof Provost CommitDate: 2025-07-03 07:16:15 +0000 pf: Honor quick on anchor rules When evaluating the anchor's ruleset, prevent clobbering it's very own `quick' test result by blindly setting it. This makes the following pf.conf work as intended (packets would be blocked since `quick' had no effect): anchor quick { pass } block Broken since after 6.1 release as reported by Fabian Mueller-Knapp, thanks! OK henning sashan Obtained from: OpenBSD, kn , b9014d31ce Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index b24bbe036141..accc811a12ba 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4675,6 +4675,12 @@ pf_step_into_anchor(struct pf_test_ctx *ctx, struct pf_krule *r) } } else { rv = pf_match_rule(ctx, &r->anchor->ruleset); + /* + * Unless there was an error inside the anchor, + * retain its quick state. + */ + if (rv != PF_TEST_FAIL && r->quick == PF_TEST_QUICK) + rv = PF_TEST_QUICK; } ctx->depth--;