diff options
author | Gary Benson <gbenson@redhat.com> | 2006-08-24 14:28:49 +0000 |
---|---|---|
committer | Gary Benson <gary@gcc.gnu.org> | 2006-08-24 14:28:49 +0000 |
commit | 9f858b070337c086dd46278bdb9ab9b1764f875d (patch) | |
tree | 1309878e77e80d6cf06466b4c8431a49943faac5 /libjava/classpath/java/net | |
parent | a418679d8d389c0960a17eded96bb9ddb7e33cb6 (diff) | |
download | gcc-9f858b070337c086dd46278bdb9ab9b1764f875d.zip gcc-9f858b070337c086dd46278bdb9ab9b1764f875d.tar.gz gcc-9f858b070337c086dd46278bdb9ab9b1764f875d.tar.bz2 |
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
Diffstat (limited to 'libjava/classpath/java/net')
-rw-r--r-- | libjava/classpath/java/net/NetworkInterface.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libjava/classpath/java/net/NetworkInterface.java b/libjava/classpath/java/net/NetworkInterface.java index 47b1c67..f6db01b 100644 --- a/libjava/classpath/java/net/NetworkInterface.java +++ b/libjava/classpath/java/net/NetworkInterface.java @@ -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) |