7132924: (dc) DatagramChannel.disconnect throws SocketException with IPv4 socket and IPv6 enabled [macosx]

Alan Bateman Alan.Bateman at oracle.com
Mon Apr 16 02:45:41 PDT 2012


This is a small bug left over from the Mac port. If IPv6 is enabled and 
a DatagramChannel is created to an IPv4-only socket then the disconnect 
method fails with an "Invalid argument" error on Mac OS X. The issue is 
that the disconnect implementation is specifying AF_INET6 as the 
protocol family when IPv6 is enabled whereas it should select the family 
based on family of the socket that the DatagramChannel is using. The fix 
is trivial:

http://cr.openjdk.java.net/~alanb/7132924/webrev/

Thanks,
Alan.


More information about the nio-dev mailing list