Commit a3374c4
tcp: fix FIONREAD/SIOCINQ
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 <enh@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent c6846ee commit a3374c4
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | | - | |
553 | 552 | | |
554 | 553 | | |
555 | 554 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
560 | 558 | | |
561 | 559 | | |
562 | 560 | | |
| |||
0 commit comments