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 <pab...@redhat.com>
---
 net/core/sock.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index ac2a404c73eb..679367ce1432 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2408,9 +2408,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;
 }
-- 
2.13.5

Reply via email to