Page MenuHomeFreeBSD

D60183.diff
No OneTemporary

D60183.diff

diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -919,8 +919,11 @@
} 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
--- /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
--- /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
--- a/sbin/pfctl/tests/pfctl_test_list.inc
+++ b/sbin/pfctl/tests/pfctl_test_list.inc
@@ -188,3 +188,4 @@
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")

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 2, 1:28 PM (1 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40036946
Default Alt Text
D60183.diff (1 KB)

Event Timeline