2002-07-18 05:00:17 +00:00
|
|
|
#!/bin/sh
|
2000-10-08 19:20:36 +00:00
|
|
|
#
|
1999-08-27 23:37:10 +00:00
|
|
|
# $FreeBSD$
|
2000-10-08 19:20:36 +00:00
|
|
|
#
|
1997-04-27 03:59:19 +00:00
|
|
|
|
2003-06-29 05:09:48 +00:00
|
|
|
# PROVIDE: netoptions
|
2007-05-02 15:32:05 +00:00
|
|
|
# REQUIRE: FILESYSTEMS
|
2004-10-07 13:55:26 +00:00
|
|
|
# KEYWORD: nojail
|
2002-07-18 05:00:17 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
2008-06-23 04:00:45 +00:00
|
|
|
_netoptions_initdone=
|
|
|
|
netoptions_init()
|
|
|
|
{
|
|
|
|
if [ -z "${_netoptions_initdone}" ]; then
|
|
|
|
echo -n 'Additional TCP/IP options:'
|
|
|
|
_netoptions_initdone=yes
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2002-07-18 05:00:17 +00:00
|
|
|
load_rc_config 'XXX'
|
|
|
|
|
|
|
|
case ${log_in_vain} in
|
|
|
|
[Nn][Oo] | '')
|
|
|
|
log_in_vain=0
|
|
|
|
;;
|
|
|
|
[Yy][Ee][Ss])
|
|
|
|
log_in_vain=1
|
|
|
|
;;
|
|
|
|
[0-9]*)
|
|
|
|
;;
|
|
|
|
*)
|
2008-06-23 04:00:45 +00:00
|
|
|
netoptions_init
|
2002-07-18 05:00:17 +00:00
|
|
|
echo " invalid log_in_vain setting: ${log_in_vain}"
|
|
|
|
log_in_vain=0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2008-06-23 12:06:35 +00:00
|
|
|
if [ "${log_in_vain}" -ne 0 ]; then
|
2008-06-23 04:00:45 +00:00
|
|
|
netoptions_init
|
2002-10-12 10:31:31 +00:00
|
|
|
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
|
2008-06-23 12:06:35 +00:00
|
|
|
fi
|
2007-05-02 15:49:30 +00:00
|
|
|
|
|
|
|
case ${tcp_extensions} in
|
|
|
|
[Yy][Ee][Ss] | '')
|
|
|
|
;;
|
|
|
|
*)
|
2008-06-23 04:00:45 +00:00
|
|
|
netoptions_init
|
2007-05-02 15:49:30 +00:00
|
|
|
echo -n ' tcp extensions=NO'
|
|
|
|
sysctl net.inet.tcp.rfc1323=0 >/dev/null
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case ${tcp_keepalive} in
|
|
|
|
[Nn][Oo])
|
2008-06-23 04:00:45 +00:00
|
|
|
netoptions_init
|
2007-05-02 15:49:30 +00:00
|
|
|
echo -n ' TCP keepalive=NO'
|
|
|
|
sysctl net.inet.tcp.always_keepalive=0 >/dev/null
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case ${tcp_drop_synfin} in
|
|
|
|
[Yy][Ee][Ss])
|
2008-06-23 04:00:45 +00:00
|
|
|
netoptions_init
|
2007-05-02 15:49:30 +00:00
|
|
|
echo -n ' drop SYN+FIN packets=YES'
|
|
|
|
sysctl net.inet.tcp.drop_synfin=1 >/dev/null
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case ${ip_portrange_first} in
|
|
|
|
[Nn][Oo] | '')
|
|
|
|
;;
|
|
|
|
*)
|
2008-06-23 04:00:45 +00:00
|
|
|
netoptions_init
|
2007-05-02 15:49:30 +00:00
|
|
|
echo -n " ip_portrange_first=$ip_portrange_first"
|
|
|
|
sysctl net.inet.ip.portrange.first=$ip_portrange_first >/dev/null
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case ${ip_portrange_last} in
|
|
|
|
[Nn][Oo] | '')
|
|
|
|
;;
|
|
|
|
*)
|
2008-06-23 04:00:45 +00:00
|
|
|
netoptions_init
|
2007-05-02 15:49:30 +00:00
|
|
|
echo -n " ip_portrange_last=$ip_portrange_last"
|
|
|
|
sysctl net.inet.ip.portrange.last=$ip_portrange_last >/dev/null
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2008-06-23 04:00:45 +00:00
|
|
|
[ -n "${_netoptions_initdone}" ] && echo '.'
|