diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2026-01-14 06:18:27 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2026-01-14 11:31:58 +0000 |
| commit | fc353e5e61fadd6ef618948f417f96381c08239c (patch) | |
| tree | a5c8c2d68267f4bba108ffb1acc9406aedee371d | |
| parent | 3a609881c8c8cbd5f4c765b27b8233ab08342309 (diff) | |
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")
| -rw-r--r-- | sbin/pfctl/parse.y | 2 | ||||
| -rw-r--r-- | sbin/pfctl/tests/files/pf1078.in | 3 | ||||
| -rw-r--r-- | sbin/pfctl/tests/files/pf1078.ok | 2 | ||||
| -rw-r--r-- | sbin/pfctl/tests/pfctl_test_list.inc | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 67e0d30890a8..72589f309f54 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -7399,7 +7399,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 a7328a860dda..ff51af7562d1 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -186,3 +186,4 @@ PFCTL_TEST_FAIL(1074, "Filter AF different than route-to AF, without prefer-ipv6 PFCTL_TEST(1075, "One shot rule") PFCTL_TEST(1076, "State limiter") PFCTL_TEST(1077, "Source limiter") +PFCTL_TEST(1078, "New page") |
