From 60613d0ae736a474058f1d70f6a98353a8558116 Mon Sep 17 00:00:00 2001 From: Martin Blapp Date: Sun, 27 Jul 2003 20:34:30 +0000 Subject: [PATCH] Add -dynamic to natd if dhcp is used for the natd interface. Kill natd in stop(). Reviewed by: mtm --- etc/rc.d/ipfw | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/etc/rc.d/ipfw b/etc/rc.d/ipfw index 531063fb3779..e43412374428 100644 --- a/etc/rc.d/ipfw +++ b/etc/rc.d/ipfw @@ -9,6 +9,7 @@ # KEYWORD: FreeBSD . /etc/rc.subr +. /etc/network.subr name="ipfw" rcvar="firewall_enable" @@ -40,6 +41,16 @@ ipfw_start() # Network Address Translation daemon # if checkyesno natd_enable; then + dhcp_list="`list_net_interfaces dhcp`" + for ifn in ${dhcp_list}; do + case ${natd_interface} in + ${ifn}) + natd_flags="$natd_flags -dynamic" + ;; + *) + ;; + esac + done if [ -n "${natd_interface}" ]; then if echo ${natd_interface} | \ grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then @@ -75,6 +86,8 @@ ipfw_stop() # Disable the firewall # ${SYSCTL_W} net.inet.ip.fw.enable=0 + killall natd; + sleep 2; } load_rc_config $name