RFR: 8231260: (dc) DatagramChannel::disconnect changes the port of the local address to 0 (lnx)

Daniel Fuchs daniel.fuchs at oracle.com
Fri Oct 4 16:07:23 UTC 2019


Hi Florian,

On 04/10/2019 16:25, Florian Weimer wrote:
> Doesn't it introduce a race condition where the socket has a port and
> queue packets, but the kernel will not perform source address checking
> because it is unconnected?

The long standing behavior of DatagramSocket::connect is to throw out
any packet in the queue after connecting, so this changes nothing.

See at line 897:
http://cr.openjdk.java.net/~dfuchs/webrev_8231260/webrev.00/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java.frames.html

best regards,

-- daniel


More information about the nio-dev mailing list