NetworkInterface.java (getInetAddresses): Bracket IPv6 addresses.

2006-08-24  Gary Benson  <gbenson@redhat.com>

	* java/net/NetworkInterface.java (getInetAddresses): Bracket IPv6
	addresses.

From-SVN: r116375
This commit is contained in:
Gary Benson 2006-08-24 14:28:49 +00:00 committed by Gary Benson
parent a418679d8d
commit 9f858b0703
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-08-24 Gary Benson <gbenson@redhat.com>
* java/net/NetworkInterface.java (getInetAddresses): Bracket IPv6
addresses.
2006-08-18 Roger Sayle <roger@eyesopen.com>
* scripts/check_jni_methods.sh: Don't use the "set -C" command

View File

@ -112,7 +112,10 @@ public final class NetworkInterface
InetAddress addr = (InetAddress) addresses.nextElement();
try
{
s.checkConnect(addr.getHostAddress(), 58000);
String hostAddress = addr.getHostAddress();
if (addr instanceof Inet6Address)
hostAddress = "[" + hostAddress + "]";
s.checkConnect(hostAddress, 58000);
tmpInetAddresses.add(addr);
}
catch (SecurityException e)