New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positives for InetAddresses.isInetAddress #3116
Comments
You're suggesting that I don't have a strong preference either way, but by what definition is this invalid? Guava isn't the only parser that works like this:
|
The RFC suggests both Guava and
|
Looking at the history of the document:
So the current behavior was standard for more than a decade, and is consistent with OpenJDK:
In other words, I don't see a compelling reason to change it. |
Internally in the private method parseHextet() of InetAddresses.isInetAddress we are using this Integer.parsrInt() method to change hex to integer. |
InetAddresses.isInetAddress method returns true for invalid IPv6 address containing two or more consecutive 0s in the last hextet.
Failing test case:
InetAddresses.isInetAddress("804c:404c::0:cc:c0:00c1c") //returns true
Expected to return false, as also verified with an online service here- https://www.helpsystems.com/intermapper/ipv6-test-address-validation
The issue seems to be due to the compression over zeroes involved.
The text was updated successfully, but these errors were encountered: