mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-07 01:36:23 +08:00
start ipv6 from 1
This commit is contained in:
@@ -42,6 +42,12 @@ func GetFirstAddr6(cidr6 string) (*ipaddr.IPAddress, error) {
|
|||||||
return nil, fmt.Errorf("invalid IPv6 CIDR provided to GetFirstAddr6")
|
return nil, fmt.Errorf("invalid IPv6 CIDR provided to GetFirstAddr6")
|
||||||
}
|
}
|
||||||
lower := currentCidr.GetLower()
|
lower := currentCidr.GetLower()
|
||||||
|
ipParts := strings.Split(lower.GetNetIPAddr().IP.String(), "::")
|
||||||
|
if len(ipParts) == 2 {
|
||||||
|
if len(ipParts[len(ipParts)-1]) == 0 {
|
||||||
|
lower = lower.Increment(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
return lower, nil
|
return lower, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user