Date: Sun, 17 Jul 2011 14:32:51 +0200 From: Jilles Tjoelker <jilles@stack.nl> To: Kevin Lo <kevlo@kevlo.org> Cc: Hiroki Sato <hrs@FreeBSD.org>, freebsd-rc@FreeBSD.org Subject: Re: [patch] /etc/rc.d/routing Message-ID: <20110717123251.GA22106@stack.nl> In-Reply-To: <1310869826.2578.5.camel@srgsec> References: <1310623300.37158.8.camel@srgsec> <20110717.033537.180999432921199548.hrs@allbsd.org> <1310869826.2578.5.camel@srgsec>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 17, 2011 at 10:30:26AM +0800, Kevin Lo wrote: > On Sun, 2011-07-17 at 03:35 +0900, Hiroki Sato wrote: > > What do you think about the attached change? > Right, jilles@ also pointed out that my change is inconsistent. > Your patch looks good. Tested on -current and it works for me. That patch removes the "echo '.'" at the end of the line. I plan to commit my own patch which does that right and also keeps at one _ropts_initdone variable that is reset in each options_$af function. Index: etc/rc.d/routing =================================================================== --- etc/rc.d/routing (revision 224104) +++ etc/rc.d/routing (working copy) @@ -48,7 +48,6 @@ done ;; esac - [ -n "${_ropts_initdone}" ] && echo '.' } routing_stop() @@ -250,19 +249,19 @@ { } -_ropts_initdone= ropts_init() { if [ -z "${_ropts_initdone}" ]; then - echo -n 'Additional routing options:' + echo -n "Additional $1 routing options:" _ropts_initdone=yes fi } options_inet() { + _ropts_initdone= if checkyesno icmp_bmcastecho; then - ropts_init + ropts_init inet echo -n ' broadcast ping responses=YES' ${SYSCTL} net.inet.icmp.bmcastecho=1 > /dev/null else @@ -270,7 +269,7 @@ fi if checkyesno icmp_drop_redirect; then - ropts_init + ropts_init inet echo -n ' ignore ICMP redirect=YES' ${SYSCTL} net.inet.icmp.drop_redirect=1 > /dev/null else @@ -278,7 +277,7 @@ fi if checkyesno icmp_log_redirect; then - ropts_init + ropts_init inet echo -n ' log ICMP redirect=YES' ${SYSCTL} net.inet.icmp.log_redirect=1 > /dev/null else @@ -286,15 +285,15 @@ fi if checkyesno gateway_enable; then - ropts_init - echo ' IPv4 gateway=YES' + ropts_init inet + echo -n ' gateway=YES' ${SYSCTL} net.inet.ip.forwarding=1 > /dev/null else ${SYSCTL} net.inet.ip.forwarding=0 > /dev/null fi if checkyesno forward_sourceroute; then - ropts_init + ropts_init inet echo -n ' do source routing=YES' ${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null else @@ -302,7 +301,7 @@ fi if checkyesno accept_sourceroute; then - ropts_init + ropts_init inet echo -n ' accept source routing=YES' ${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null else @@ -310,38 +309,51 @@ fi if checkyesno arpproxy_all; then - ropts_init + ropts_init inet echo -n ' ARP proxyall=YES' ${SYSCTL} net.link.ether.inet.proxyall=1 > /dev/null else ${SYSCTL} net.link.ether.inet.proxyall=0 > /dev/null fi + + [ -n "${_ropts_initdone}" ] && echo '.' } options_inet6() { + _ropts_initdone= + if checkyesno ipv6_gateway_enable; then - ropts_init - echo ' IPv6 gateway=YES' + ropts_init inet6 + echo -n ' gateway=YES' ${SYSCTL} net.inet6.ip6.forwarding=1 > /dev/null else ${SYSCTL} net.inet6.ip6.forwarding=0 > /dev/null fi + + [ -n "${_ropts_initdone}" ] && echo '.' } options_atm() { + _ropts_initdone= + + [ -n "${_ropts_initdone}" ] && echo '.' } options_ipx() { + _ropts_initdone= + if checkyesno ipxgateway_enable; then - ropts_init + ropts_init ipx echo -n ' IPX gateway=YES' ${SYSCTL} net.ipx.ipx.ipxforwarding=1 > /dev/null else ${SYSCTL} net.ipx.ipx.ipxforwarding=0 > /dev/null fi + + [ -n "${_ropts_initdone}" ] && echo '.' } load_rc_config $name -- Jilles Tjoelker
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110717123251.GA22106>