diff options
author | Robert Schuster <theBohemian@gmx.net> | 2006-10-24 23:32:25 +0000 |
---|---|---|
committer | Robert Schuster <theBohemian@gmx.net> | 2006-10-24 23:32:25 +0000 |
commit | 9c82c20e633d27a6a62d36c2dbf0aee2a377aa64 (patch) | |
tree | 41036b695d1af52d48ae691fc3d75b2a97d31284 | |
parent | decadab307d6855e39a5ffa27967fa9568954b91 (diff) | |
download | classpath-9c82c20e633d27a6a62d36c2dbf0aee2a377aa64.tar.gz |
2006-10-25 Robert Schuster <robertschuster@fsfe.org>
Fixes PR29576
* java/net/MulticastSocket.java:
(getNetworkInterface): Return a special NetworkInterface instance
if the socket's multicast interface is set to any.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | java/net/MulticastSocket.java | 4 |
2 files changed, 11 insertions, 0 deletions
@@ -1,6 +1,13 @@ 2006-10-25 Robert Schuster <robertschuster@fsfe.org> Fixes PR29576 + * java/net/MulticastSocket.java: + (getNetworkInterface): Return a special NetworkInterface instance + if the socket's multicast interface is set to any. + +2006-10-25 Robert Schuster <robertschuster@fsfe.org> + + Fixes PR29576 * java/net/NetworkInterface.java: (createAnyInterface): New method. (equals): Added if-statement to handle case where netif.name is null. diff --git a/java/net/MulticastSocket.java b/java/net/MulticastSocket.java index 03bdf1e77..389b6908e 100644 --- a/java/net/MulticastSocket.java +++ b/java/net/MulticastSocket.java @@ -230,6 +230,10 @@ public class MulticastSocket extends DatagramSocket InetAddress address = (InetAddress) getImpl().getOption(SocketOptions.IP_MULTICAST_IF); + + if (address.isAnyLocalAddress()) + return NetworkInterface.createAnyInterface(); + NetworkInterface netIf = NetworkInterface.getByInetAddress(address); return netIf; |