Re: RFR (S) 8230407 : SocketPermission and FilePermission action list allows leading comma

2019-10-04 Thread Chris Hegarty
Ivan, > On 4 Oct 2019, at 03:00, Ivan Gerasimov wrote: > > ... > > I've adopted your suggested changes and the test: > http://cr.openjdk.java.net/~igerasim/8230407/02/webrev/ > LGTM. > CSR was also updated accordingly: > https://bugs.

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

2019-10-04 Thread Daniel Fuchs
Hi, Please find below a fix for: 8231260: (dc) DatagramChannel::disconnect changes the port of the local address to 0 (lnx) https://bugs.openjdk.java.net/browse/JDK-8231260 The nature of the fix introduces an unlucky (though unlikely) case where an exception might get thrown which leav

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

2019-10-04 Thread Alan Bateman
On 04/10/2019 14:34, Daniel Fuchs wrote: : webrev: http://cr.openjdk.java.net/~dfuchs/webrev_8231260/webrev.00/ The apiNote looks okay. DatagramChannelImpl::disconnect looks okay but I assume "might not preserve" should be "does not preserve" (if you make that change then the "This is the exp

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

2019-10-04 Thread Daniel Fuchs
On 04/10/2019 14:55, Alan Bateman wrote: On 04/10/2019 14:34, Daniel Fuchs wrote: : webrev: http://cr.openjdk.java.net/~dfuchs/webrev_8231260/webrev.00/ The apiNote looks okay. DatagramChannelImpl::disconnect looks okay but I assume "might not preserve" should be "does not preserve" (if you m

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

2019-10-04 Thread Florian Weimer
* Daniel Fuchs: > Hi, > > Please find below a fix for: > > 8231260: (dc) DatagramChannel::disconnect changes the port of the > local address to 0 (lnx) > https://bugs.openjdk.java.net/browse/JDK-8231260 I remember looking at this a couple of years ago. I was mostly concerned about the l

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

2019-10-04 Thread Alan Bateman
On 04/10/2019 16:25, Florian Weimer wrote: : @@ -873,10 +873,15 @@ synchronized (stateLock) { ensureOpen(); if (state == ST_CONNECTED) throw new AlreadyConnectedException(); +// ensure t

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

2019-10-04 Thread Florian Weimer
* Alan Bateman: > On 04/10/2019 16:25, Florian Weimer wrote: >> : >> @@ -873,10 +873,15 @@ >> synchronized (stateLock) { >> ensureOpen(); >> if (state == ST_CONNECTED) >> throw new AlreadyConnectedException();

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

2019-10-04 Thread Daniel Fuchs
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 a

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

2019-10-04 Thread Florian Weimer
* Florian Weimer: > * Alan Bateman: > >> On 04/10/2019 16:25, Florian Weimer wrote: >>> : >>> @@ -873,10 +873,15 @@ >>> synchronized (stateLock) { >>> ensureOpen(); >>> if (state == ST_CONNECTED) >>> throw new

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

2019-10-04 Thread Alan Bateman
On 04/10/2019 17:03, Florian Weimer wrote: : The kernel will do it atomically during connect, so there is no race condition. With the change above, the port is selected and opened, packets can arrive (from arbitrary addresses), and only then the socket is bound to the remote address. I don't se

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

2019-10-04 Thread Florian Weimer
* Daniel Fuchs: > 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 DatagramSo

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

2019-10-04 Thread Florian Weimer
* Alan Bateman: > On 04/10/2019 17:03, Florian Weimer wrote: >> : >> The kernel will do it atomically during connect, so there is no race >> condition. With the change above, the port is selected and opened, >> packets can arrive (from arbitrary addresses), and only then the socket >> is bound to