diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 432dc9af117203d3d4b2b0ee4241dac26f510b72..30c6e94b06c49d2b5a18d5708560b02cc9f48aae 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1901,6 +1901,11 @@ static int tcp_inq_hint(struct sock *sk) inq = tp->rcv_nxt - tp->copied_seq; release_sock(sk); } + /* After receiving a FIN, tell the user-space to continue reading + * by returning a non-zero inq. + */ + if (inq == 0 && sock_flag(sk, SOCK_DONE)) + inq = 1; return inq; }