Commit 257a7303 authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller

net/sock: allow the user to set negative peek offset

This is necessary to allow the user to disable peeking with
offset once it's enabled.
Unix sockets already allow the above, with this patch we
permit it for udp[6] sockets, too.

Fixes: 627d2d6b ("udp: enable MSG_PEEK at non-zero offset")
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Acked-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 110d8465
...@@ -2454,9 +2454,6 @@ EXPORT_SYMBOL(__sk_mem_reclaim); ...@@ -2454,9 +2454,6 @@ EXPORT_SYMBOL(__sk_mem_reclaim);
int sk_set_peek_off(struct sock *sk, int val) int sk_set_peek_off(struct sock *sk, int val)
{ {
if (val < 0)
return -EINVAL;
sk->sk_peek_off = val; sk->sk_peek_off = val;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment