changeset 7242:982f4666e2b6

8028074: InetAddress.getByName fails with UHE "invalid IPv6 address" if host name starts with a-f Reviewed-by: chegar
author igerasim
date Mon, 23 Jun 2014 18:27:36 +0400
parents 488d331ecd1e
children 5f5b1e1b514a
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	Thu Jun 19 12:56:16 2014 +0200
+++ b/src/share/classes/java/net/InetAddress.java	Mon Jun 23 18:27:36 2014 +0400
@@ -1137,7 +1137,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) {