]> err.no Git - linux-2.6/commitdiff
[IPV6]: Do not change protocol for UDPv6 sockets with pending sent data.
authorDenis V. Lunev <den@openvz.org>
Wed, 4 Jun 2008 11:49:08 +0000 (15:49 +0400)
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Wed, 4 Jun 2008 19:02:38 +0000 (04:02 +0900)
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
net/ipv6/ipv6_sockglue.c

index 1afe210d62861a295af673fcc0e3bad1d925a553..26b83e512a0922d86c38144a1c53052b0163eed7 100644 (file)
@@ -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) {