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

Commit a96fb49b authored by Flavio Leitner's avatar Flavio Leitner Committed by David S. Miller
Browse files

[NET]: Fix IP_ADD/DROP_MEMBERSHIP to handle only connectionless



Fix IP[V6]_ADD_MEMBERSHIP and IP[V6]_DROP_MEMBERSHIP to
return -EPROTO for connection oriented sockets.

Signed-off-by: default avatarFlavio Leitner <fleitner@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 36d98d3e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -625,6 +625,10 @@ static int do_ip_setsockopt(struct sock *sk, int level,
	{
		struct ip_mreqn mreq;

		err = -EPROTO;
		if (inet_sk(sk)->is_icsk)
			break;

		if (optlen < sizeof(struct ip_mreq))
			goto e_inval;
		err = -EFAULT;
+4 −0
Original line number Diff line number Diff line
@@ -554,6 +554,10 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
	{
		struct ipv6_mreq mreq;

		retv = -EPROTO;
		if (inet_sk(sk)->is_icsk)
			break;

		retv = -EFAULT;
		if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq)))
			break;