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:
parent
a418679d8d
commit
9f858b0703
2 changed files with 9 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue