Hi all,
This commit makes NetworkInterface.getInetAddresses() bracket IPv6
addresses before calling SecurityManager.checkConnect() with them.
This fixes http://gcc.gnu.org/ml/java/2006-08/msg00082.html.
Cheers,
Gary
Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.8447
diff -u -r1.8447 ChangeLog
--- ChangeLog 24 Aug 2006 06:40:04 -0000 1.8447
+++ ChangeLog 24 Aug 2006 10:57:43 -0000
@@ -1,3 +1,8 @@
+2006-08-24 Gary Benson <[EMAIL PROTECTED]>
+
+ * java/net/NetworkInterface.java (getInetAddresses): Bracket IPv6
+ addresses.
+
2006-08-24 Jeroen Frijters <[EMAIL PROTECTED]>
* java/lang/ref/Reference.java
Index: java/net/NetworkInterface.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/NetworkInterface.java,v
retrieving revision 1.16
diff -u -r1.16 NetworkInterface.java
--- java/net/NetworkInterface.java 7 Aug 2005 21:42:40 -0000 1.16
+++ java/net/NetworkInterface.java 24 Aug 2006 10:57:43 -0000
@@ -112,7 +112,10 @@
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)