How do people use npf with dhcpcd?

David Brownlee <[email protected]>
Newsgroups gmane.os.netbsd.current
Message-ID <CAGN_6pa2u9XNnb_ZXAGDG6iB9xymcuwzxcP022QLn8bK2TOUAw@mail.gmail.com>
I have a couple of systems which use dhcpcd to get an IP address, but
also use npf for various filtering and other tasks.

 My npf.conf contains the below, which fails when rge0 does not (yet)
have an IP address

$int_if = "rge0"
$int_ip = inet4($int_if)

So far I have worked around this by having the following in rc.conf

if ifconfig rge0 | grep -q 'inet ' ; then
    npf_rules=/etc/npf.conf
else
    npf_rules=/etc/npf.boot
fi

and calling /etc/rc.d/npf reload in dhcpcd.exit-hooks, but this
seems... inelegant

Am I missing something obvious?

Thanks

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.