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

Commit 9596cc82 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by YOSHIFUJI Hideaki
Browse files

[IPV6]: Do not change protocol for UDPv6 sockets with pending sent data.

parent 36d926b9
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -164,9 +164,14 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
			if (sk->sk_type == SOCK_RAW)
				break;

			if (sk->sk_protocol != IPPROTO_UDP &&
			    sk->sk_protocol != IPPROTO_UDPLITE &&
			    sk->sk_protocol != IPPROTO_TCP)
			if (sk->sk_protocol == IPPROTO_UDP ||
			    sk->sk_protocol == IPPROTO_UDPLITE) {
				struct udp_sock *up = udp_sk(sk);
				if (up->pending == AF_INET6) {
					retv = -EBUSY;
					break;
				}
			} else if (sk->sk_protocol != IPPROTO_TCP)
				break;

			if (sk->sk_state != TCP_ESTABLISHED) {