summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2008-06-23 04:00:45 +0000
committermtm <mtm@FreeBSD.org>2008-06-23 04:00:45 +0000
commite01154eb3a51571240a8d6b08dd06f9618a1bb37 (patch)
treedd04cc47006daa7c923c405524f275d2d3801dfb
parente3f330d43d688bc4b1309e576028e312f48b9230 (diff)
downloadFreeBSD-src-e01154eb3a51571240a8d6b08dd06f9618a1bb37.zip
FreeBSD-src-e01154eb3a51571240a8d6b08dd06f9618a1bb37.tar.gz
Do not print anything unless one of the net/routing options is set.
-rw-r--r--etc/rc.d/netoptions19
-rw-r--r--etc/rc.d/routing20
2 files changed, 35 insertions, 4 deletions
diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions
index 7104952..51d5f79 100644
--- a/etc/rc.d/netoptions
+++ b/etc/rc.d/netoptions
@@ -9,9 +9,17 @@
. /etc/rc.subr
+_netoptions_initdone=
+netoptions_init()
+{
+ if [ -z "${_netoptions_initdone}" ]; then
+ echo -n 'Additional TCP/IP options:'
+ _netoptions_initdone=yes
+ fi
+}
+
load_rc_config 'XXX'
-echo -n 'Additional IP options:'
case ${log_in_vain} in
[Nn][Oo] | '')
log_in_vain=0
@@ -22,12 +30,14 @@ case ${log_in_vain} in
[0-9]*)
;;
*)
+ netoptions_init
echo " invalid log_in_vain setting: ${log_in_vain}"
log_in_vain=0
;;
esac
[ "${log_in_vain}" -ne 0 ] && (
+ netoptions_init
echo -n " log_in_vain=${log_in_vain}"
sysctl net.inet.tcp.log_in_vain="${log_in_vain}" >/dev/null
sysctl net.inet.udp.log_in_vain="${log_in_vain}" >/dev/null
@@ -37,6 +47,7 @@ case ${tcp_extensions} in
[Yy][Ee][Ss] | '')
;;
*)
+ netoptions_init
echo -n ' tcp extensions=NO'
sysctl net.inet.tcp.rfc1323=0 >/dev/null
;;
@@ -44,6 +55,7 @@ esac
case ${tcp_keepalive} in
[Nn][Oo])
+ netoptions_init
echo -n ' TCP keepalive=NO'
sysctl net.inet.tcp.always_keepalive=0 >/dev/null
;;
@@ -51,6 +63,7 @@ esac
case ${tcp_drop_synfin} in
[Yy][Ee][Ss])
+ netoptions_init
echo -n ' drop SYN+FIN packets=YES'
sysctl net.inet.tcp.drop_synfin=1 >/dev/null
;;
@@ -60,6 +73,7 @@ case ${ip_portrange_first} in
[Nn][Oo] | '')
;;
*)
+ netoptions_init
echo -n " ip_portrange_first=$ip_portrange_first"
sysctl net.inet.ip.portrange.first=$ip_portrange_first >/dev/null
;;
@@ -69,9 +83,10 @@ case ${ip_portrange_last} in
[Nn][Oo] | '')
;;
*)
+ netoptions_init
echo -n " ip_portrange_last=$ip_portrange_last"
sysctl net.inet.ip.portrange.last=$ip_portrange_last >/dev/null
;;
esac
-echo '.'
+[ -n "${_netoptions_initdone}" ] && echo '.'
diff --git a/etc/rc.d/routing b/etc/rc.d/routing
index 818df92..563826d 100644
--- a/etc/rc.d/routing
+++ b/etc/rc.d/routing
@@ -59,11 +59,20 @@ static_start()
fi
}
+_ropts_initdone=
+ropts_init()
+{
+ if [ -z "${_ropts_initdone}" ]; then
+ echo -n 'Additional routing options:'
+ _ropts_initdone=yes
+ fi
+}
+
options_start()
{
- echo -n 'Additional routing options:'
case ${icmp_bmcastecho} in
[Yy][Ee][Ss])
+ ropts_init
echo -n ' broadcast ping responses=YES'
sysctl net.inet.icmp.bmcastecho=1 >/dev/null
;;
@@ -71,6 +80,7 @@ options_start()
case ${icmp_drop_redirect} in
[Yy][Ee][Ss])
+ ropts_init
echo -n ' ignore ICMP redirect=YES'
sysctl net.inet.icmp.drop_redirect=1 >/dev/null
;;
@@ -78,6 +88,7 @@ options_start()
case ${icmp_log_redirect} in
[Yy][Ee][Ss])
+ ropts_init
echo -n ' log ICMP redirect=YES'
sysctl net.inet.icmp.log_redirect=1 >/dev/null
;;
@@ -85,6 +96,7 @@ options_start()
case ${gateway_enable} in
[Yy][Ee][Ss])
+ ropts_init
echo -n ' IP gateway=YES'
sysctl net.inet.ip.forwarding=1 >/dev/null
;;
@@ -92,6 +104,7 @@ options_start()
case ${forward_sourceroute} in
[Yy][Ee][Ss])
+ ropts_init
echo -n ' do source routing=YES'
sysctl net.inet.ip.sourceroute=1 >/dev/null
;;
@@ -99,6 +112,7 @@ options_start()
case ${accept_sourceroute} in
[Yy][Ee][Ss])
+ ropts_init
echo -n ' accept source routing=YES'
sysctl net.inet.ip.accept_sourceroute=1 >/dev/null
;;
@@ -106,6 +120,7 @@ options_start()
case ${ipxgateway_enable} in
[Yy][Ee][Ss])
+ ropts_init
echo -n ' IPX gateway=YES'
sysctl net.ipx.ipx.ipxforwarding=1 >/dev/null
;;
@@ -113,12 +128,13 @@ options_start()
case ${arpproxy_all} in
[Yy][Ee][Ss])
+ ropts_init
echo -n ' ARP proxyall=YES'
sysctl net.link.ether.inet.proxyall=1 >/dev/null
;;
esac
- echo '.'
+ [ -n "${_ropts_initdone}" ] && echo '.'
}
load_rc_config $name
OpenPOWER on IntegriCloud