8028074: InetAddress.getByName fails with UnknownHostException: invalid IPv6 address if host name starts with a-f
Alan Bateman
Alan.Bateman at oracle.com
Fri Nov 8 12:39:15 PST 2013
There's a small problem with the fix for JDK- 8019834 that was pushed to
jdk8/tl today. The patch means that UHE is thrown when doing a lookup of
hosts that start with a-f. I ran into it because I happen to be on a
machine that starts with "a" :-)
I'd like to get a patch into jdk8/tl quickly so that others don't run
into this. The proposed patch is attached.
-Alan
diff --git a/src/share/classes/java/net/InetAddress.java
b/src/share/classes/java/net/InetAddress.java
--- a/src/share/classes/java/net/InetAddress.java
+++ b/src/share/classes/java/net/InetAddress.java
@@ -1144,7 +1144,7 @@
ifname = host.substring (pos+1);
}
}
- if ((addr = IPAddressUtil.textToNumericFormatV6(host))
== null) {
+ if ((addr = IPAddressUtil.textToNumericFormatV6(host))
== null && host.contains(":")) {
throw new UnknownHostException(host + ": invalid
IPv6 address");
}
} else if (ipv6Expected) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20131108/e8dccd9b/attachment.html
More information about the net-dev
mailing list