git: d2d25d8fde2e - stable/14 - pfctl: allow new page character (^L) in pf.conf
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 28 Jan 2026 19:20:21 UTC
The branch stable/14 has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=d2d25d8fde2e19fb880c913dcc53871ef0588b55
commit d2d25d8fde2e19fb880c913dcc53871ef0588b55
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-01-14 06:18:27 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-01-28 09:08:59 +0000
pfctl: allow new page character (^L) in pf.conf
PF configuration files can contains many things.
Using the new page characters (i.e. ^L, \014) to mark the beginning
of parts is useful because many editors such as emacs and vim has
facilities to jump next/previous ones.
PR: 86635
MFC after: 2 weeks
Submitted by: MOROHOSHI Akihiko <moro@remus.dti.ne.jp>
Submitted by: Simon Wollwage <rootnode+freebsd@wollwage.com>
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit fc353e5e61fadd6ef618948f417f96381c08239c)
---
sbin/pfctl/parse.y | 2 +-
sbin/pfctl/tests/files/pf1078.in | 3 +++
sbin/pfctl/tests/files/pf1078.ok | 2 ++
sbin/pfctl/tests/pfctl_test_list.inc | 1 +
4 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index ddee0bda8b9a..58245ca642e0 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -6510,7 +6510,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ' || c == '\t')
+ while ((c = lgetc(0)) == ' ' || c == '\t' || c == '\014')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/sbin/pfctl/tests/files/pf1078.in b/sbin/pfctl/tests/files/pf1078.in
new file mode 100644
index 000000000000..11ce16d5fdc9
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1078.in
@@ -0,0 +1,3 @@
+pass in proto tcp
+
+pass in proto udp
diff --git a/sbin/pfctl/tests/files/pf1078.ok b/sbin/pfctl/tests/files/pf1078.ok
new file mode 100644
index 000000000000..585236af942a
--- /dev/null
+++ b/sbin/pfctl/tests/files/pf1078.ok
@@ -0,0 +1,2 @@
+pass in proto tcp all flags S/SA keep state
+pass in proto udp all keep state
diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc
index 5d5aa0172530..bb2b5b49496e 100644
--- a/sbin/pfctl/tests/pfctl_test_list.inc
+++ b/sbin/pfctl/tests/pfctl_test_list.inc
@@ -128,3 +128,4 @@ PFCTL_TEST(1016, "Ethernet rule with ridentifier and one label")
PFCTL_TEST(1017, "Ethernet rule with ridentifier and several labels")
PFCTL_TEST(1018, "Test dynamic address mask")
PFCTL_TEST(1020, "Test hashmark and semicolon comment")
+PFCTL_TEST(1078, "New page")