- Add ipfw_nat to the list of required modules if "firewall_nat_enable"
is set and "natd_enable" is NOT set; - Accept and pass firewall type to the external firewall script. Submitted by: Yuri Kurenkov < y -dot- kurenkov -at- init -dot- ru > MFC after: 3 days No response from: freebsd-rc
This commit is contained in:
parent
cf1c8d5f9c
commit
f631c013c2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=190575
@ -23,10 +23,20 @@ ipfw_prestart()
|
||||
if checkyesno dummynet_enable; then
|
||||
required_modules="$required_modules dummynet"
|
||||
fi
|
||||
|
||||
if checkyesno firewall_nat_enable; then
|
||||
if ! checkyesno natd_enable; then
|
||||
required_modules="$required_modules ipfw_nat"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ipfw_start()
|
||||
{
|
||||
local _firewall_type
|
||||
|
||||
_firewall_type=$1
|
||||
|
||||
# set the firewall rules script if none was specified
|
||||
[ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall
|
||||
|
||||
@ -34,7 +44,7 @@ ipfw_start()
|
||||
if [ -f /etc/rc.d/natd ] ; then
|
||||
/etc/rc.d/natd quietstart
|
||||
fi
|
||||
/bin/sh "${firewall_script}"
|
||||
/bin/sh "${firewall_script}" "${_firewall_type}"
|
||||
echo 'Firewall rules loaded.'
|
||||
elif [ "`ipfw list 65535`" = "65535 deny ip from any to any" ]; then
|
||||
echo 'Warning: kernel has firewall functionality, but' \
|
||||
@ -67,4 +77,4 @@ ipfw_stop()
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
||||
run_rc_command $*
|
||||
|
Loading…
Reference in New Issue
Block a user