diff --git a/lib/attack.go b/lib/attack.go index ce1e76a7..caebba6f 100644 --- a/lib/attack.go +++ b/lib/attack.go @@ -356,7 +356,9 @@ func DNSCaching(ttl time.Duration) func(*Attacker) { for _, ip := range ips { go func(ip string) { conn, err := dial(ctx, network, net.JoinHostPort(ip, port)) - cancel() + if err == nil { + cancel() + } ch <- result{conn, err} }(ip) }