PF syntax parser counts macro lines splited using "\" as a single line. To reproduce the issue: # cat -n pf.test 1 internal_net="{ 192.168.0.0/24 \ 2 192.168.1.0/24 192.168.2.0/24 }" 3 4 pass in on em0 \ 5 from a to b # pfctl -nf pf.test no IP address found for a pf.test:4: could not parse host specification Ref: https://forums.freebsd.org/threads/wrong-error-line-number-given-by-pf-syntax-checker.52121/#post-292829
I forgot to mention it effects 9.3-RELEASE and 10.1-RELEASE. I don't know about stable and current.
Someone pointed out to me the example is misleading. This one is much clearer. # cat -n pf.test 1 internal_net="{ 192.168.0.0/24 \ 2 192.168.1.0/24 \ 3 192.168.2.0/24 }" 4 5 pass in on em0 from a to b 6 # pfctl -nf pf.test no IP address found for a pf.test:3: could not parse host specification
A commit references this bug: Author: kp Date: Mon Oct 22 04:12:51 UTC 2018 New revision: 339578 URL: https://svnweb.freebsd.org/changeset/base/339578 Log: pfctl: Fix line numbers when \ is used inside "" PR: 201520 Obtained from: OpenBSD MFC after: 2 weeks Changes: head/sbin/pfctl/parse.y
A commit references this bug: Author: kp Date: Sun Nov 18 10:54:39 UTC 2018 New revision: 340560 URL: https://svnweb.freebsd.org/changeset/base/340560 Log: MFC r339578: pfctl: Fix line numbers when \ is used inside "" PR: 201520 Obtained from: OpenBSD Changes: _U stable/11/ stable/11/sbin/pfctl/parse.y
A commit references this bug: Author: kp Date: Sun Nov 18 10:54:47 UTC 2018 New revision: 340561 URL: https://svnweb.freebsd.org/changeset/base/340561 Log: MFC r339578: pfctl: Fix line numbers when \ is used inside "" PR: 201520 Obtained from: OpenBSD Changes: _U stable/12/ stable/12/sbin/pfctl/parse.y