[IPV6]: Do not change protocol for UDPv6 sockets with pending sent data.
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
This commit is contained in:
parent
36d926b94a
commit
9596cc826e
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue