Flagging pf

D'Arcy Cain <[email protected]> Sat, 19 Nov 2011 00:02:54 -0500
Newsgroups gmane.os.netbsd.devel.general
Organization The NetBSD Project
Message-ID <[email protected]>
Is there any reason that /etc/rc.d doesn't use the ${pf_flags} variable? 
  Something as simple as this:

Index: pf
===================================================================
RCS file: /cvsroot/src/etc/rc.d/pf,v
retrieving revision 1.9
diff -u -r1.9 pf
--- pf  22 Nov 2008 20:23:33 -0000      1.9
+++ pf  19 Nov 2011 05:02:28 -0000
@@ -35,11 +35,11 @@

         # The pf_boot script has enabled pf already.
         if [ "$autoboot" != yes ]; then
-               /sbin/pfctl -q -e
+               /sbin/pfctl -q ${pf_flags} -e
         fi

         if [ -f ${pf_rules} ]; then
-               /sbin/pfctl -q -f ${pf_rules}
+               /sbin/pfctl -q ${pf_flags} -f ${pf_rules}
         else
                 warn "${pf_rules} not found; no pf rules loaded."
         fi
@@ -48,14 +48,14 @@
  pf_stop()
  {
         echo "Disabling pf firewall."
-       /sbin/pfctl -q -Fa -d
+       /sbin/pfctl -q ${pf_flags} -Fa -d
  }

  pf_reload()
  {
         echo "Reloading pf rules."
         if [ -f ${pf_rules} ]; then
-               /sbin/pfctl -q -f ${pf_rules}
+               /sbin/pfctl -q ${pf_flags} -f ${pf_rules}
         else
                 warn "${pf_rules} not found; no pf rules loaded."
         fi
@@ -63,7 +63,7 @@

  pf_status()
  {
-       /sbin/pfctl -s info
+       /sbin/pfctl ${pf_flags} -s info
  }

  load_rc_config $name


-- 
D'Arcy J.M. Cain <[email protected]>
http://www.NetBSD.org/