git: 434e1c3d8413 - main - pfctl tests: test rdr-to and nat-to in one rule

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Sun, 22 Mar 2026 07:23:57 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=434e1c3d84135d1c3a6e578fdfa4b508f0914494

commit 434e1c3d84135d1c3a6e578fdfa4b508f0914494
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-03-22 06:20:48 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-03-22 06:20:48 +0000

    pfctl tests: test rdr-to and nat-to in one rule
    
    OpenBSD fixed this separately (in their 6a338f3f70). We appear to not
    have had this bug, but test for it anyway.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sbin/pfctl/tests/files/pf1079.in     | 2 ++
 sbin/pfctl/tests/files/pf1079.ok     | 1 +
 sbin/pfctl/tests/pfctl_test_list.inc | 1 +
 3 files changed, 4 insertions(+)

diff --git a/sbin/pfctl/tests/files/pf1079.in b/sbin/pfctl/tests/files/pf1079.in
new file mode 100644
index 000000000000..78a3f148f815
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1079.in
@@ -0,0 +1,2 @@
+pass in on lo0 proto tcp from any to 1.2.3.4/32 port 2222 rdr-to 10.0.0.10 nat-to 10.0.0.2 port 22
+
diff --git a/sbin/pfctl/tests/files/pf1079.ok b/sbin/pfctl/tests/files/pf1079.ok
new file mode 100644
index 000000000000..437e881855a1
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1079.ok
@@ -0,0 +1 @@
+pass in on lo0 inet proto tcp from any to 1.2.3.4 port = 2222 flags S/SA keep state nat-to 10.0.0.2 port 22 rdr-to 10.0.0.10
diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc
index ff51af7562d1..a2c64dfc0020 100644
--- a/sbin/pfctl/tests/pfctl_test_list.inc
+++ b/sbin/pfctl/tests/pfctl_test_list.inc
@@ -187,3 +187,4 @@ PFCTL_TEST(1075, "One shot rule")
 PFCTL_TEST(1076, "State limiter")
 PFCTL_TEST(1077, "Source limiter")
 PFCTL_TEST(1078, "New page")
+PFCTL_TEST(1079, "rdr-to and nat-to")