aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2008-04-15 03:07:15 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-15 03:07:15 -0400
commita198d3a200313bca8261e30e6daaad790937fd7e (patch)
treeb6a47a0bd1056c2b30b3bdd2e9ba0c91fa4f6301
parent990098068fe963f956c14f681bd88d90dcb14584 (diff)
[TIPC]: Allow stream receive to read from multiple TIPC messages
This patch allows a stream socket to receive data from multiple TIPC messages in its receive queue, without requiring the use of the MSG_WAITALL flag. Acknowledgements to Florian Westphal <fw-tipc@strlen.de> for identifying this issue and suggesting how to correct it. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/tipc/socket.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 91aa2dc51771..c1a199c0fa6d 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1065,7 +1065,9 @@ restart:
1065 /* Loop around if more data is required */ 1065 /* Loop around if more data is required */
1066 1066
1067 if ((sz_copied < buf_len) /* didn't get all requested data */ 1067 if ((sz_copied < buf_len) /* didn't get all requested data */
1068 && (flags & MSG_WAITALL) /* ... and need to wait for more */ 1068 && (!skb_queue_empty(&sock->sk->sk_receive_queue) ||
1069 (flags & MSG_WAITALL))
1070 /* ... and more is ready or required */
1069 && (!(flags & MSG_PEEK)) /* ... and aren't just peeking at data */ 1071 && (!(flags & MSG_PEEK)) /* ... and aren't just peeking at data */
1070 && (!err) /* ... and haven't reached a FIN */ 1072 && (!err) /* ... and haven't reached a FIN */
1071 ) 1073 )