Bug 242044

Summary: pf can't load rules with newline at end.
Product: Base System Reporter: sasamotikomi
Component: kernAssignee: freebsd-pf mailing list <pf>
Status: Closed Works As Intended    
Severity: Affects Many People CC: kp
Priority: ---    
Version: 12.1-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
pf failed config none

Description sasamotikomi 2019-11-18 03:21:27 UTC
Remove newline at end of file and your rules will fail.
Comment 1 Kristof Provost freebsd_committer 2019-11-18 16:08:32 UTC
Can you attach an example failing pf.conf file?

If I understand you correctly you're saying that a ruleset which doesn't have an endline on the last line does not work.
I wouldn't consider that to be a bug.
Comment 2 sasamotikomi 2019-11-23 01:14:46 UTC
Created attachment 209352 [details]
pf failed config

Example of not working rules.
Comment 3 Kristof Provost freebsd_committer 2019-11-23 18:27:08 UTC
Does your pfctl not warn about this?

On CURRENT and on 11.3 pfctl produces this error message for me:
> pf_no_endl.conf:2: syntax error
> pfctl: Syntax error in config file: pf rules not loaded

Given that I don't consider this to be a bug. That's a malformed pf.conf which the code is appropriately rejecting and warning about.