summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorSoheil Hassas Yeganeh <soheil@google.com>2019-03-06 13:01:36 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-19 13:10:54 +0100
commit75c9b039f9bdf59f4fd74b1cf3db7321497653fa (patch)
treef88d6ab873221f6b74d75e7965369bcee3683233 /net/ipv4/tcp_ipv4.c
parent05ad31a85e96bba6c2725f41f91f910d6a4ec21e (diff)
downloadtalos-obmc-linux-75c9b039f9bdf59f4fd74b1cf3db7321497653fa.tar.gz
talos-obmc-linux-75c9b039f9bdf59f4fd74b1cf3db7321497653fa.zip
tcp: do not report TCP_CM_INQ of 0 for closed connections
[ Upstream commit 6466e715651f9f358e60c5ea4880e4731325827f ] Returning 0 as inq to userspace indicates there is no more data to read, and the application needs to wait for EPOLLIN. For a connection that has received FIN from the remote peer, however, the application must continue reading until getting EOF (return value of 0 from tcp_recvmsg) or an error, if edge-triggered epoll (EPOLLET) is being used. Otherwise, the application will never receive a new EPOLLIN, since there is no epoll edge after the FIN. Return 1 when there is no data left on the queue but the connection has received FIN, so that the applications continue reading. Fixes: b75eba76d3d72 (tcp: send in-queue bytes in cmsg upon read) Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud