changeset 8768:50df04934e86

8028074: InetAddress.getByName fails with UHE "invalid IPv6 address" if host name starts with a-f Reviewed-by: chegar
author alanb
date Fri, 08 Nov 2013 21:07:42 +0000
parents 11376ad23e21
children df2f7f288353
files src/share/classes/java/net/InetAddress.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/net/InetAddress.java	Fri Nov 08 12:19:25 2013 -0800
+++ b/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) {