MaxTimeout is the maximum timeout, not the minimum

Fixes #977
This commit is contained in:
Frank Denis 2019-10-22 11:50:08 +02:00
parent 92e632daf1
commit 94c16c3167
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ func NetProbe(address string, timeout int) error {
if timeout < 0 {
timeout = MaxTimeout
} else {
timeout = Max(MaxTimeout, timeout)
timeout = Min(MaxTimeout, timeout)
}
for tries := timeout; tries > 0; tries-- {
pc, err := net.DialUDP("udp", nil, remoteUDPAddr)