Ahem,
and here is the patch.

Robert Schuster wrote:
> Hi,
> with this small change to MulticastSocket a proper instance is returned when 
> the
> socket's multicast interface results to any.
> 
> I know: Test would be nice. I am working on it. :)
> 
> ChangeLog:
> 2006-10-25  Robert Schuster  <[EMAIL PROTECTED]>
> 
>         Fixes PR29576
>         * java/net/MulticastSocket.java:
>         (getNetworkInterface): Return a special NetworkInterface instance
>         if the socket's multicast interface is set to any.
> 
> cya
> Robert
Index: java/net/MulticastSocket.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/MulticastSocket.java,v
retrieving revision 1.26
diff -u -r1.26 MulticastSocket.java
--- java/net/MulticastSocket.java	2 Jul 2005 20:32:39 -0000	1.26
+++ java/net/MulticastSocket.java	24 Oct 2006 23:28:09 -0000
@@ -230,6 +258,10 @@
 
     InetAddress address =
       (InetAddress) getImpl().getOption(SocketOptions.IP_MULTICAST_IF);
+    
+    if (address.isAnyLocalAddress())
+      return NetworkInterface.createAnyInterface();
+    
     NetworkInterface netIf = NetworkInterface.getByInetAddress(address);
 
     return netIf;

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to