From de991565df6c114c1bf6226d9f0669b86f34f29e Mon Sep 17 00:00:00 2001 From: andre Date: Fri, 22 Oct 2004 19:36:03 +0000 Subject: Automatically load the ipdivert module if it was not compiled into the kernel and natd_enable is true. --- etc/rc.d/natd | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'etc/rc.d/natd') diff --git a/etc/rc.d/natd b/etc/rc.d/natd index 4bfdcfc..60e9e15 100644 --- a/etc/rc.d/natd +++ b/etc/rc.d/natd @@ -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`" -- cgit v1.1