diff options
author | Paolo Abeni <pabeni@redhat.com> | 2017-08-23 12:57:51 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-24 08:18:44 +0300 |
commit | 257a73031d29447ee82fe06d2b97d8564f63276d (patch) | |
tree | e622eb1f5b7e926aec046378b95111ea14f23a38 /net/core | |
parent | 110d8465a66aea440ca0012f8b8ac59778dea189 (diff) | |
download | linux-257a73031d29447ee82fe06d2b97d8564f63276d.tar.xz |
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: 627d2d6b5500 ("udp: enable MSG_PEEK at non-zero offset")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/sock.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 0f04d8bff607..dfdd14cac775 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -2454,9 +2454,6 @@ EXPORT_SYMBOL(__sk_mem_reclaim); int sk_set_peek_off(struct sock *sk, int val) { - if (val < 0) - return -EINVAL; - sk->sk_peek_off = val; return 0; } |