Skip to content

Commit

Permalink
fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
uoosef committed Jan 31, 2024
1 parent 6cb2305 commit fdd1912
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion warp/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"net"
)

var previousIP string

// Dialer is a struct that holds various options for custom dialing.
type Dialer struct {
}
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit fdd1912

Please sign in to comment.