From nobody Wed Sep 30 22:02:57 2026 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 4hw8Dd6Gfcz6tK71 for ; Wed, 30 Sep 2026 22:02:57 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hw8Dd5jBQz3LTg for ; Wed, 30 Sep 2026 22:02:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790805777; 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=PcK3OtTfTQQeJtC3tUK6/70/qyzRiJzPqgW0brrE5xQ=; b=YgO/FDzxjciboEEpMCVO88jue7X3qI77itjXZB1YryQMPex4sQHHFKEEs/JokguWp6FQnT 8mnOtNv18HdBXKF41+9YsS05WbZp1FUQKZskHi34ylKizqTHkVofvOvB036DYf0NuKu5ve +BKbni3P3AGr/TW9XJqRxPOURR/KwS2JohJiyoh9uFL+VmMH7o01TR/pGvXrRqz2XTqnBM uR4PmfKHWO+bnPPvIZBkGbumrOiFCOOCiMxvgaJdPEz3NyTggAwVRGHHmIEzSRZjPOqzIr jh+LbrYDFBeahh4O2iLzRMuwrTEGI8lhw8B9WBYQBwVu5YbiJsVXF3tBMhq5EQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790805777; b=HKknPwcT3OQdmKmcZsVjynNSHVdcQwDz2IQ4KlZ5sWQyFpALf7C7Hv+PLHo7eEtuPZCq34 DBQpmKJ0woFeTEQjMl7KQlcHo6Wz0VLcebqClMlUD4cyvWfskTRSPqvC4/USolpRykMz6P nhw3AyAXc51v+aq5UsGOoJzebMFT/ozk3dABsbh66h+KS68PzwWIh78pumNCF955fh8OLj 7F2XZ9wQY46nzaR/AKFemCRDGQ/LHtHRQg/hhNKmwhAPUWWBEQpK3ZrS7ZAYzsTqV/pw7d O+R5GFal0ieyGLWQlpVtdKfDxy/sVp5i5rZ6umPFyduwTgE2rML7KC3ywWEulA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790805777; 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=PcK3OtTfTQQeJtC3tUK6/70/qyzRiJzPqgW0brrE5xQ=; b=eLpNNTiVfn629d4nKreCd5FC7stlLf+4j2sdQ01+F+ar/SxyhiR8SpamUuUqnljVB8ZkHI XaHti2ZsOqqniS9CSE5tHkqr8zyG6igxTq4d3tjIhxSkFQPxiOelcFbanIXUAfEbGHmgzt sKdMESwlNSCH6G8tt0unEOsC/F3koauRg3O/Re6xNG/pE5rJ0ireI0aYLV6BlM+dULwnkx +TPVO4ISVgpPRVeJoYtt1R9xaF8OHdZ23aFoieIUo2xEM1IfMumTzBGeO3Ax9T+Uq5xEFl jc3FEiP8qO8ZdM4zTkIYWYwF6/5OVjOLaIAer5YljfxVkTXh3C4FDqFtUNGwxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hw8Dd4lH3z144n for ; Wed, 30 Sep 2026 22:02:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c10a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 30 Sep 2026 22:02:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: R. Christian McDonald Subject: git: 3171a60de403 - main - pfctl: print "pass" on nat/rdr/binat rules again 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rcm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3171a60de403b9088b870d38377039ab9718b7db Auto-Submitted: auto-generated Date: Wed, 30 Sep 2026 22:02:57 +0000 Message-Id: <6abd8711.3c10a.7fed13e7@gitrepo.freebsd.org> The branch main has been updated by rcm: URL: https://cgit.FreeBSD.org/src/commit/?id=3171a60de403b9088b870d38377039ab9718b7db commit 3171a60de403b9088b870d38377039ab9718b7db Author: R. Christian McDonald AuthorDate: 2026-09-30 21:58:19 +0000 Commit: R. Christian McDonald CommitDate: 2026-09-30 22:02:46 +0000 pfctl: print "pass" on nat/rdr/binat rules again c2d03a920ec7 rewrote the action printing in print_rule() from OpenBSD, which has no natpass, and dropped the "pass" keyword. A ruleset loaded from "pfctl -sn" output therefore lost its nat-pass semantics. Add a parser test covering nat, rdr, rdr log and binat with pass. Reviewed by: kp Approved by: kp (mentor) Fixes: c2d03a920ec7 ("pfctl: fix anchortypes bounds test") MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D60183 --- sbin/pfctl/pfctl_parser.c | 5 ++++- sbin/pfctl/tests/files/pf1080.in | 5 +++++ sbin/pfctl/tests/files/pf1080.ok | 5 +++++ sbin/pfctl/tests/pfctl_test_list.inc | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index c6ad62555b86..46e8f81d0693 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -919,8 +919,11 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int opts, int numeric) } else { if (r->action >= nitems(actiontypes)) printf("action(%d)", r->action); - else + else { printf("%s", actiontypes[r->action]); + if (r->natpass) + printf(" pass"); + } } if (r->action == PF_DROP) { if (r->rule_flag & PFRULE_RETURN) diff --git a/sbin/pfctl/tests/files/pf1080.in b/sbin/pfctl/tests/files/pf1080.in new file mode 100644 index 000000000000..d0316a1cd6cb --- /dev/null +++ b/sbin/pfctl/tests/files/pf1080.in @@ -0,0 +1,5 @@ +nat pass on em0 from 192.0.2.0/24 to any -> 198.51.100.1 +rdr pass on em0 proto tcp from any to 198.51.100.1 port 80 -> 192.0.2.10 +rdr pass log on em0 proto tcp from any to 198.51.100.1 port 443 -> 192.0.2.10 +binat pass on em0 from 192.0.2.20 to any -> 198.51.100.20 +rdr on em0 proto tcp from any to 198.51.100.1 port 22 -> 192.0.2.10 diff --git a/sbin/pfctl/tests/files/pf1080.ok b/sbin/pfctl/tests/files/pf1080.ok new file mode 100644 index 000000000000..f2e61a691563 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1080.ok @@ -0,0 +1,5 @@ +nat pass on em0 inet from 192.0.2.0/24 to any -> 198.51.100.1 +rdr pass on em0 inet proto tcp from any to 198.51.100.1 port = http -> 192.0.2.10 +rdr pass log on em0 inet proto tcp from any to 198.51.100.1 port = https -> 192.0.2.10 +rdr on em0 inet proto tcp from any to 198.51.100.1 port = ssh -> 192.0.2.10 +binat pass on em0 inet from 192.0.2.20 to any -> 198.51.100.20 diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index a2c64dfc0020..1c0251543147 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -188,3 +188,4 @@ PFCTL_TEST(1076, "State limiter") PFCTL_TEST(1077, "Source limiter") PFCTL_TEST(1078, "New page") PFCTL_TEST(1079, "rdr-to and nat-to") +PFCTL_TEST(1080, "nat/rdr/binat pass")