Reduce nc timeout in sys.mac.portacl.*

It is not necessary to wait that long for localhost.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Li-Wen Hsu 2020-02-11 20:41:51 +00:00
parent 25aa4a3c07
commit ec5fd09524
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=357778

View File

@ -17,6 +17,7 @@ check_bind() {
local host idtype name proto port udpflag
host="127.0.0.1"
timeout=1
idtype=${1}
name=${2}
@ -28,7 +29,7 @@ check_bind() {
out=$(
case "${idtype}" in
uid|gid)
( echo -n | su -m ${name} -c "nc ${udpflag} -l -w 10 $host $port" 2>&1 ) &
( echo -n | su -m ${name} -c "nc ${udpflag} -l -w ${timeout} $host $port" 2>&1 ) &
;;
jail)
kill $$
@ -37,7 +38,7 @@ check_bind() {
kill $$
esac
sleep 0.3
echo | nc ${udpflag} -w 10 $host $port >/dev/null 2>&1
echo | nc ${udpflag} -w ${timeout} $host $port >/dev/null 2>&1
wait
)
case "${out}" in