Module Name:    src
Committed By:   sborrill
Date:           Fri Nov 26 13:11:36 UTC 2021

Modified Files:
        src/etc/rc.d: npf_boot pf_boot

Log Message:
Load rc configuration based on rcvar, not name, so that correct settings
in /etc/rc.conf.d are loaded.

Usually this does not matter as rcvar and name are set to the same value.
For pf_boot and npf_boot, rcvar is set to pf and npf respectively.

Prior to the change, if:
rc.conf contains nfp=YES
rc.conf.d/npf does not exist

Then:
/etc/rc.d/npf_boot rcvar
outputs:
# npf_boot
$npf=YES

If:
rc.conf contains npf=NO (or is not set)
rc.conf.d/npf contains npf=YES

Then:
/etc/rc.d/npf_boot rcvar
outputs:
# npf_boot
$npf=NO

This means that in the latter case, at boot time the npfctl start command
is never run and the firewall is not operational.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/etc/rc.d/npf_boot
cvs rdiff -u -r1.7 -r1.8 src/etc/rc.d/pf_boot

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.d/npf_boot
diff -u src/etc/rc.d/npf_boot:1.4 src/etc/rc.d/npf_boot:1.5
--- src/etc/rc.d/npf_boot:1.4	Tue Sep  8 12:52:18 2020
+++ src/etc/rc.d/npf_boot	Fri Nov 26 13:11:36 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: npf_boot,v 1.4 2020/09/08 12:52:18 martin Exp $
+# $NetBSD: npf_boot,v 1.5 2021/11/26 13:11:36 sborrill Exp $
 #
 
 # PROVIDE: npf_boot
@@ -29,5 +29,5 @@ npf_boot_start()
 	/sbin/npfctl start
 }
 
-load_rc_config $name
+load_rc_config $rcvar
 run_rc_command "$1"

Index: src/etc/rc.d/pf_boot
diff -u src/etc/rc.d/pf_boot:1.7 src/etc/rc.d/pf_boot:1.8
--- src/etc/rc.d/pf_boot:1.7	Tue Sep  8 12:52:18 2020
+++ src/etc/rc.d/pf_boot	Fri Nov 26 13:11:36 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: pf_boot,v 1.7 2020/09/08 12:52:18 martin Exp $
+# $NetBSD: pf_boot,v 1.8 2021/11/26 13:11:36 sborrill Exp $
 #
 
 # PROVIDE: pf_boot
@@ -29,5 +29,5 @@ pf_boot_start()
 	/sbin/pfctl -q -e
 }
 
-load_rc_config $name
+load_rc_config $rcvar
 run_rc_command "$1"

Reply via email to