From nobody Thu Jan 04 22:08:48 2024 X-Original-To: dev-commits-src-all@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 4T5ghw6jJlz55NQx; Thu, 4 Jan 2024 22:08:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T5ghw4hkzz4MWc; Thu, 4 Jan 2024 22:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704406128; 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=2wsm6BWsy3NbO38QhAbtz+HC64VmOt/q3LosQBBwkro=; b=uEOYJx0dvmw4n0hXdcNHlYGCrZ1e4WVaISudEJe3MMDapOitQyPkhKMdVC/Bz40ZGUbO5t eNO7DVZNXRE118mL4QdjDhtbZSIHS4IQ2nKbEYpI95sBaaBKnZM6XTlMBTTkFAiaGEu8b7 NaTcuEbofnTMNTEcYMWE8qnn94lzO/F6CENQzxw7ESg2QEO4r4i0I0D/fNpgxxObtk5TAO 7R4W6uge968QGOkLc64UNvXSTL6R0gR5jyx0y4IDcXFp3RprXuk4EolylWWljgQPKt9j9A xhlBAn81kDaGqHi/6sHn0JEiUX9I4xQvr+leKLAUeCaPO7otU5Rfl9G4MQsfRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704406128; 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=2wsm6BWsy3NbO38QhAbtz+HC64VmOt/q3LosQBBwkro=; b=hFwPwpS08b8lTqhnddeDF85YaJgQ/FCnZ4KLcfobdgXSCTgMvXhQ8HmpNBTgSB1OsfyV/b 0/0gwbcUHYuTDWIRCUidnxQrsipfihuToKSzhwID552l5hdFPjbYpDNqmoBwh590srOmjg jdKOjqGpfAn+Oe2wklLFLtOoQcKyOkLMqfiqIEcB6VlbvNUFkXN97chOutPf2gkfn2RRQP 7qtpVbgRC9+7vamhvdrJowv2/b4XTzLLNAO/DP0TtOLrgAOvlKAtNkv0DQChwbRIvCH7Ax AslhqsG5RS0u3DCUb7OkhoWOMndhJl9ShK+EfpXGxp7zkBtsnUfILTqbsjilpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704406128; a=rsa-sha256; cv=none; b=a2Cj4Me5uX3KrqYhcEGXMU4joYBoILfsxOjYFgJUuSVCgqLugydIDyqjzLB2nreMO9dUhS a+/9p3tzAL+20SFrkZw+aDfAgGGl2xjbw5EoQGcW3EFv4iTbEYvLROg3423Q31QOgL4myl BK3/C1Jfjo00LtejbwFc6ivSKNClUjjR85S3clQrfi8SmS9gsdyDP8QbTXaR/3+XDlkEno Z08rCYoMG8hvX2SYVz+McHNEZv625LcH5/3oS/LSdtUv+/K8+JO3Id1naUYXZrcuNHD8V6 ssW8O7+q4x7icGLCoVXBNuWtRrPPx1UPdxjN2JgrzcJpQOEtoW/jO3T/XF7OTw== 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 4T5ghw3nKnzXTJ; Thu, 4 Jan 2024 22:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 404M8m6g090954; Thu, 4 Jan 2024 22:08:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 404M8mLe090951; Thu, 4 Jan 2024 22:08:48 GMT (envelope-from git) Date: Thu, 4 Jan 2024 22:08:48 GMT Message-Id: <202401042208.404M8mLe090951@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: 5f840a1758b4 - main - pf: don't clobber log flag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 5f840a1758b4bbb4892118f43f40c6487c17aeba Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5f840a1758b4bbb4892118f43f40c6487c17aeba commit 5f840a1758b4bbb4892118f43f40c6487c17aeba Author: Kristof Provost AuthorDate: 2024-01-02 13:54:06 +0000 Commit: Kristof Provost CommitDate: 2024-01-04 22:08:08 +0000 pf: don't clobber log flag If we decide to discard a packet due to unexpected IP options or unsupported headers we set pd.act.log. However, this can later get overwritten when we copy the state's saved actions over. Merge the two log fields to ensure we log as expected. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e19370cc7333..9e9743c1e5e0 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8210,7 +8210,9 @@ done: } if (s) { + uint8_t log = pd.act.log; memcpy(&pd.act, &s->act, sizeof(struct pf_rule_actions)); + pd.act.log |= log; tag = s->tag; rt = s->rt; } else { @@ -8819,7 +8821,9 @@ done: } if (s) { + uint8_t log = pd.act.log; memcpy(&pd.act, &s->act, sizeof(struct pf_rule_actions)); + pd.act.log |= log; tag = s->tag; rt = s->rt; } else {