Solved [PF] "self" keyword behavior when interfaces change

I'm using the self keyword so I don't have to hardcode my adresses
eg.
Code:
pass in proto tcp to self port 22
(this machine is a gateway, I don't want to match forwarded packets)

The problem is (I think, couldn't find any bit of documentation about that) self is only expanded when loading the rules, and never updated... which means if I bring a new interface up it won't accept traffic unless I reload the rules.

Can anyone confirm my hypothesis about self's behavior?

I could add pfctl -f /etc/pf.conf in all my post-up scripts (that's my workaround for now), but I was wondering if there's a better way to do this?
Like telling the kernel to re-expand the rules every time an interface changes its IPs or something.
 
Back
Top