]> git.baikalelectronics.ru Git - kernel.git/commit
vsock/virtio: set SOCK_DONE on peer shutdown
authorStephen Barber <smbarber@chromium.org>
Sat, 15 Jun 2019 06:42:37 +0000 (23:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Jun 2019 21:01:09 +0000 (14:01 -0700)
commite3174cdd7804302a976a32bb6cacfe20cac0c0b7
tree682bf98a5b4c1c4721c9ef5f0ee430b9dcaf13a6
parent60fad61d63cfbe4c5fd08ae4996d5f649c7121a4
vsock/virtio: set SOCK_DONE on peer shutdown

Set the SOCK_DONE flag to match the TCP_CLOSING state when a peer has
shut down and there is nothing left to read.

This fixes the following bug:
1) Peer sends SHUTDOWN(RDWR).
2) Socket enters TCP_CLOSING but SOCK_DONE is not set.
3) read() returns -ENOTCONN until close() is called, then returns 0.

Signed-off-by: Stephen Barber <smbarber@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/vmw_vsock/virtio_transport_common.c