datagram: Add offset argument to __skb_recv_datagram
This one is only considered for MSG_PEEK flag and the value pointed by it specifies where to start peeking bytes from. If the offset happens to point into the middle of the returned skb, the offset within this skb is put back to this very argument. 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>
This commit is contained in:
committed by
David S. Miller
parent
4934b0329f
commit
3f518bf745
@@ -342,7 +342,7 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
|
||||
struct inet_sock *inet = inet_sk(sk);
|
||||
struct sk_buff *skb;
|
||||
unsigned int ulen, copied;
|
||||
int peeked;
|
||||
int peeked, off = 0;
|
||||
int err;
|
||||
int is_udplite = IS_UDPLITE(sk);
|
||||
int is_udp4;
|
||||
@@ -359,7 +359,7 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
|
||||
|
||||
try_again:
|
||||
skb = __skb_recv_datagram(sk, flags | (noblock ? MSG_DONTWAIT : 0),
|
||||
&peeked, &err);
|
||||
&peeked, &off, &err);
|
||||
if (!skb)
|
||||
goto out;
|
||||
|
||||
|
Reference in New Issue
Block a user