diff -ur /etc/defaults/rc.conf ./defaults/rc.conf --- /etc/defaults/rc.conf 2023-08-12 15:43:39.730058729 +0100 +++ ./defaults/rc.conf 2023-10-03 12:17:20.533770082 +0100 @@ -180,7 +180,7 @@ ifconfig_wait_dad_flags="-w 15 -W 5" mdnsd=NO -npf=NO +npf=NO npf_rules="/etc/npf.conf" npfd=NO npfd_flags="" ipfilter=NO ipfilter_flags="" # uses /etc/ipf.conf ipnat=NO # uses /etc/ipnat.conf diff -ur /etc/rc.d/npf ./rc.d/npf --- /etc/rc.d/npf 2022-12-22 15:00:43.082087239 +0000 +++ ./rc.d/npf 2023-10-03 12:19:31.541816743 +0100 @@ -14,8 +14,6 @@ name="npf" rcvar=$name -config="/etc/npf.conf" - start_cmd="npf_start" stop_cmd="npf_stop" @@ -23,19 +21,20 @@ status_cmd="npf_status" extra_commands="reload status" -npf_cfg_check() + +npf_cfg_check_and_reload() { - if [ ! -f ${config} ]; then - warn "${config} is not readable; failed." + if [ ! -f "${npf_rules}" ]; then + warn "${npf_rules} is not readable; failed." exit 1 fi + /sbin/npfctl reload "${npf_rules}" } npf_start() { - echo "Enabling NPF." - npf_cfg_check - /sbin/npfctl reload + echo "Enabling NPF ($npf_rules)." + npf_cfg_check_and_reload # The npf_boot script has enabled npf already. if [ "$autoboot" != "yes" ]; then @@ -52,9 +51,8 @@ npf_reload() { - echo "Reloading NPF ruleset." - npf_cfg_check - /sbin/npfctl reload + echo "Reloading NPF ruleset ($npf_rules)." + npf_cfg_check_and_reload } npf_status()