Reputation: 135
I'm working on IPV6 validation both server (java) and client (javascript) side and i have Incompatibility issue with the following IPs:
both of them have an extra zero and looks invalid to me.
My javascript validation (based on http://www.intermapper.com/support/tools/IPV6-Validator.aspx) return invalid but my server side says it's a valid IP.
In the server side, I'm checking 2 options:
1. java.net.InetAddress.getByName("");
2. com.google.common.net.InetAddresses.isInetAddress("");
Can you please advise?
Thanks!
Upvotes: 0
Views: 211
Reputation: 9980
RFC 4291 describes the textual representation of IPv6 addresses.
It specifies that each of the fields is "one to four hexadecimal digits" (section 2.2). This is in line with the fact that the IPv6 address is a 128-bit binary value (RFC 3587); thus any extra digits would cause the value to be more than 128 bits and therefore invalid..
Whatever tool you are using that said these addresses are valid, it is broken.
Upvotes: 2