8028074: InetAddress.getByName fails with UHE "invalid IPv6 address" if host name starts with a-f
authoralanb
Fri, 08 Nov 2013 21:07:42 +0000
changeset 21635 b938024653ca
parent 21634 55914541c844
child 21636 fcec9002d5f4
8028074: InetAddress.getByName fails with UHE "invalid IPv6 address" if host name starts with a-f Reviewed-by: chegar
jdk/src/share/classes/java/net/InetAddress.java
--- a/jdk/src/share/classes/java/net/InetAddress.java	Fri Nov 08 12:19:25 2013 -0800
+++ b/jdk/src/share/classes/java/net/InetAddress.java	Fri Nov 08 21:07:42 2013 +0000
@@ -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) {