RFR [14] 8236441: Bound MulticastSocket fails when setting outbound interface on Windows

Chris Hegarty chris.hegarty at oracle.com
Fri Dec 20 17:53:27 UTC 2019


The MulticastSocket implementation on Windows uses the two stacks
implementation. The two stacks implementation creates a socket on the
IPv4 stack and another on the IPv6 stack. Operations are then performed
on both sockets as appropriate. If the socket is bound to a specific
address, then the IP version of the socket that matches that address is
retained, and the other closed.

This is a complicated implementation, which will hopefully be replaced
soon, but in the meantime there is a serious bug with handling the
IP_MULTICAST_IF[2] socket option. The code does not correctly cater for
the fact that one of the file descriptors may be closed, leading to
SocketExceptions with a message of: "An operation was attempted on
something that is not a socket (Error setting socket option)"

Webrev:
  https://cr.openjdk.java.net/~chegar/8236441/webrev.00/
JIRA:
  https://bugs.openjdk.java.net/browse/JDK-8236441

-Chris.



More information about the net-dev mailing list