]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/unix/af_unix.c
datagram: When peeking datagrams with offset < 0 don't skip empty skbs
[karo-tx-linux.git] / net / unix / af_unix.c
index 7b52a380d710d238c440293b6d3b8973fc30c90c..be8982b4f8c00be8bb95748c1c33a76e13079dff 100644 (file)
@@ -2304,10 +2304,7 @@ static int unix_stream_read_generic(struct unix_stream_read_state *state,
         */
        mutex_lock(&u->iolock);
 
-       if (flags & MSG_PEEK)
-               skip = sk_peek_offset(sk, flags);
-       else
-               skip = 0;
+       skip = max(sk_peek_offset(sk, flags), 0);
 
        do {
                int chunk;