Automatically load the ipdivert module if it was not compiled into the kernel

and natd_enable is true.
This commit is contained in:
Andre Oppermann 2004-10-22 19:36:03 +00:00
parent 21dcc96f4a
commit e3d53beb77
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136791

View File

@ -12,8 +12,21 @@
name="natd"
rcvar=`set_rcvar`
command="/sbin/${name}"
start_precmd="natd_precmd"
start_cmd="natd_start"
natd_precmd()
{
if ! ${SYSCTL} net.inet.divert > /dev/null 2>&1; then
if ! kldload ipdivert; then
warn unable to load IPDIVERT module.
return 1
fi
fi
return 0
}
natd_start()
{
dhcp_list="`list_net_interfaces dhcp`"