diff --git a/libexec/rc/rc.d/ipfw b/libexec/rc/rc.d/ipfw index fd1c97671d70..22b65d2908cb 100755 --- a/libexec/rc/rc.d/ipfw +++ b/libexec/rc/rc.d/ipfw @@ -47,7 +47,7 @@ ipfw_prestart() ipfw_start() { - local _firewall_type + local _firewall_type _module _sysctl_reload if [ -n "${1}" ]; then _firewall_type=$1 @@ -55,6 +55,19 @@ ipfw_start() _firewall_type=${firewall_type} fi + _sysctl_reload=no + for _module in ${required_modules} + do + if kldstat -qn ${_module}; then + _sysctl_reload=yes + break + fi + done + + if [ ${_sysctl_reload} = yes ]; then + /etc/rc.d/sysctl reload + fi + # set the firewall rules script if none was specified [ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall