Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a198d3a2 authored by Allan Stephens's avatar Allan Stephens Committed by David S. Miller
Browse files

[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: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99009806
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1065,7 +1065,9 @@ restart:
	/* Loop around if more data is required */
	/* Loop around if more data is required */


	if ((sz_copied < buf_len)    /* didn't get all requested data */
	if ((sz_copied < buf_len)    /* didn't get all requested data */
	    && (flags & MSG_WAITALL) /* ... and need to wait for more */
	    && (!skb_queue_empty(&sock->sk->sk_receive_queue) ||
		(flags & MSG_WAITALL))
				     /* ... and more is ready or required */
	    && (!(flags & MSG_PEEK)) /* ... and aren't just peeking at data */
	    && (!(flags & MSG_PEEK)) /* ... and aren't just peeking at data */
	    && (!err)                /* ... and haven't reached a FIN */
	    && (!err)                /* ... and haven't reached a FIN */
	    )
	    )