Date: Sun, 22 Mar 2009 12:04:32 -0700 From: Maksim Yevmenkin <maksim.yevmenkin@gmail.com> To: freebsd-rc@freebsd.org Cc: Yuri Kurenkov <y.kurenkov@init.ru> Subject: [patch] /etc/rc.d/ipfw Message-ID: <bb4a86c70903221204s110913c7p590b8797fbf83a72@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
hello, would anyone object to the following small patch to /etc/rc.d/ifpw. this is basically to teach ipfw to 1) load ipfw_nat module when nat is required and natd is _not_ used 2) pass firewall type to rc.firewall script thanks, max ==== > diff -u /etc/rc.d/ipfw ipfw --- /etc/rc.d/ipfw 2008-07-24 07:02:05.000000000 -0700 +++ ipfw 2009-03-22 11:53:19.000000000 -0700 @@ -23,10 +23,19 @@ 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 +43,7 @@ if [ -f /etc/rc.d/natd ] ; then /etc/rc.d/natd start 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' \ @@ -65,4 +74,4 @@ } load_rc_config $name -run_rc_command "$1" +run_rc_command "$*"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bb4a86c70903221204s110913c7p590b8797fbf83a72>