]> git.baikalelectronics.ru Git - kernel.git/commit
unix: Support peeking offset for stream sockets
authorPavel Emelyanov <xemul@parallels.com>
Tue, 21 Feb 2012 07:32:06 +0000 (07:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Feb 2012 20:03:58 +0000 (15:03 -0500)
commit7033b9a78eb52af77eb61bf2a2071d057de4175c
tree75ad4f14627fa05d39533177523dfd3d2454fa68
parent49514f20b41f140d64bf8ddc221da0a2d09fb0d5
unix: Support peeking offset for stream sockets

The same here -- we can protect the sk_peek_off manipulations with
the unix_sk->readlock mutex.

The peeking of data from a stream socket is done in the datagram style,
i.e. even if there's enough room for more data in the user buffer, only
the head skb's data is copied in there. This feature is preserved when
peeking data from a given offset -- the data is read till the nearest
skb's boundary.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/unix/af_unix.c