Control: reopen -1 Control: found -1 1.130-3 Control: tag -1 upstream On Mon, 12 Dec 2016 at 15:18:53 +0000, Guilhem Moulin wrote: > We believe that the bug you reported is fixed in the latest version of > netcat-openbsd, which is due to be installed in the Debian FTP > archive.
My attempt at fixing this was broken and let to regressions, cf.
#849192.
Problem is that the server doesn't react to the client's SHUT_WD. See
the difference in the strace(1) outputs between stream sockets (TCP):
poll([{fd=-1}, {fd=4, events=0}, {fd=4, events=POLLIN}, {fd=1, events=0}],
4, -1) = 1 ([{fd=4, revents=POLLIN}])
read(4, "test\n", 16384) = 5
poll([{fd=-1}, {fd=-1}, {fd=4, events=POLLIN}, {fd=1, events=POLLOUT}], 4,
-1) = 2 ([{fd=4, revents=POLLIN}, {fd=1, revents=POLLOUT}])
read(4, "", 16379) = 0
shutdown(4, SHUT_RD) = 0
write(1, "test\n", 5test
) = 5
and now for datagrams:
poll([{fd=-1}, {fd=3, events=0}, {fd=3, events=POLLIN}, {fd=1, events=0}],
4, -1) = 1 ([{fd=3, revents=POLLIN}])
read(3, "test\n", 16384) = 5
poll([{fd=-1}, {fd=-1}, {fd=3, events=POLLIN}, {fd=1, events=POLLOUT}], 4,
-1) = 1 ([{fd=1, revents=POLLOUT}])
write(1, "test\n", 5test
) = 5
poll([{fd=-1}, {fd=-1}, {fd=3, events=POLLIN}, {fd=1, events=0}], 4, 0…
So for stream sockets the server gets a revents=POLLIN on the network
socket (I guess due to the TCP FIN), receive EOF, and shuts down its end
of the socket. But for datagrams each party waits for some activity
from the other end. A workaround for now is to pass ‘-w0’ on the
client.
Cheers,
--
Guilhem.
signature.asc
Description: PGP signature

