summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-11-05 03:36:01 -0800
committerDavid S. Miller <davem@davemloft.net>2008-11-05 03:36:01 -0800
commit518a09ef11f8454f4676125d47c3e775b300c6a5 (patch)
treea22f9f9de58e91d3287bcd21277e9378de49e18f /net
parentefb9a8c28ca0edd9e2572117105ebad9bbc0c368 (diff)
downloadblackbird-op-linux-518a09ef11f8454f4676125d47c3e775b300c6a5.tar.gz
blackbird-op-linux-518a09ef11f8454f4676125d47c3e775b300c6a5.zip
tcp: Fix recvmsg MSG_PEEK influence of blocking behavior.
Vito Caputo noticed that tcp_recvmsg() returns immediately from partial reads when MSG_PEEK is used. In particular, this means that SO_RCVLOWAT is not respected. Simply remove the test. And this matches the behavior of several other systems, including BSD. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index eccb7165a80c..c5aca0bb116a 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1374,8 +1374,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
sk->sk_state == TCP_CLOSE ||
(sk->sk_shutdown & RCV_SHUTDOWN) ||
!timeo ||
- signal_pending(current) ||
- (flags & MSG_PEEK))
+ signal_pending(current))
break;
} else {
if (sock_flag(sk, SOCK_DONE))
OpenPOWER on IntegriCloud