mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-27 12:52:27 +02:00
internal: only delete old ipv6 if it is non-link local
So the client is removed from table only when it's global ipv6 changed.
This commit is contained in:
committed by
Cuong Manh Le
parent
affef963c1
commit
b002dff624
@@ -115,6 +115,15 @@ func IsIPv6(ip string) bool {
|
||||
return parsedIP != nil && parsedIP.To4() == nil && parsedIP.To16() != nil
|
||||
}
|
||||
|
||||
// IsLinkLocalUnicastIPv6 checks if the provided IP is a link local unicast v6 address.
|
||||
func IsLinkLocalUnicastIPv6(ip string) bool {
|
||||
parsedIP := net.ParseIP(ip)
|
||||
if parsedIP == nil || parsedIP.To4() != nil || parsedIP.To16() == nil {
|
||||
return false
|
||||
}
|
||||
return parsedIP.To16().IsLinkLocalUnicast()
|
||||
}
|
||||
|
||||
type parallelDialerResult struct {
|
||||
conn net.Conn
|
||||
err error
|
||||
|
||||
Reference in New Issue
Block a user