From: Eric Dumazet <redacted>
Date: Thu, 18 Oct 2012 21:14:12 +0200
From: Eric Dumazet <redacted>
tcp_ioctl() tries to take into account if tcp socket received a FIN
to report correct number bytes in receive queue.
But its flaky because if the application ate the last skb,
we return 1 instead of 0.
Correct way to detect that FIN was received is to test SOCK_DONE.
Reported-by: Elliot Hughes <redacted>
Signed-off-by: Eric Dumazet <redacted>
Applied and queued up for -stable.