examples: additional check for IPv6 completeness

See neo-project/non-native-contracts#4.
This commit is contained in:
Roman Khimov 2021-09-09 19:35:17 +03:00
parent 04bbeccca6
commit 137d1a3ac1

View file

@ -613,6 +613,9 @@ func checkIPv6(data string) bool {
nums[idx] = n
}
}
if l < 8 && !hasEmpty {
return false
}
f0 := nums[0]
if f0 < 0x2000 || f0 == 0x2002 || f0 == 0x3ffe || f0 > 0x3fff { // IPv6 Global Unicast https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml