提交 8abf8a12 编写于 作者: A alanb

8028074: InetAddress.getByName fails with UHE "invalid IPv6 address" if host name starts with a-f

Reviewed-by: chegar
上级 52f1cc60
......@@ -1144,7 +1144,7 @@ class InetAddress implements java.io.Serializable {
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册