From fdd1912bebd23304ea9c24bc53ad489ed288548c Mon Sep 17 00:00:00 2001 From: uoosef Date: Wed, 31 Jan 2024 20:17:40 +0330 Subject: [PATCH] fix minor bugs --- warp/tls.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/warp/tls.go b/warp/tls.go index 8fadd8356..f41a4c438 100644 --- a/warp/tls.go +++ b/warp/tls.go @@ -8,6 +8,8 @@ import ( "net" ) +var previousIP string + // Dialer is a struct that holds various options for custom dialing. type Dialer struct { } @@ -193,11 +195,12 @@ GENERATE: } ip = net.IPv4(r[0], r[1], r[2], r[3]) - if ip.Equal(ipnet.IP) || r[3] == 255 { + if ip.Equal(ipnet.IP) || r[3] == 255 || ip.String() == previousIP { // we got unlucky. The host portion of our ipv4 address was // either all 0s (the network address) or all 1s (the broadcast address) goto GENERATE } + previousIP = ip.String() return ip, nil }