From fed4650b3f3923a569990cbfbc6589121aa94d38 Mon Sep 17 00:00:00 2001 From: 0xdcarns Date: Thu, 21 Apr 2022 11:27:32 -0400 Subject: [PATCH] start ipv6 from 1 --- logic/ips/ips.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/logic/ips/ips.go b/logic/ips/ips.go index 477c906c..e691b773 100644 --- a/logic/ips/ips.go +++ b/logic/ips/ips.go @@ -42,6 +42,12 @@ func GetFirstAddr6(cidr6 string) (*ipaddr.IPAddress, error) { return nil, fmt.Errorf("invalid IPv6 CIDR provided to GetFirstAddr6") } 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 }