Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -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;
}
}