diff options
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 1afe210d6286..26b83e512a09 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -164,9 +164,14 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
164 | if (sk->sk_type == SOCK_RAW) | 164 | if (sk->sk_type == SOCK_RAW) |
165 | break; | 165 | break; |
166 | 166 | ||
167 | if (sk->sk_protocol != IPPROTO_UDP && | 167 | if (sk->sk_protocol == IPPROTO_UDP || |
168 | sk->sk_protocol != IPPROTO_UDPLITE && | 168 | sk->sk_protocol == IPPROTO_UDPLITE) { |
169 | sk->sk_protocol != IPPROTO_TCP) | 169 | struct udp_sock *up = udp_sk(sk); |
170 | if (up->pending == AF_INET6) { | ||
171 | retv = -EBUSY; | ||
172 | break; | ||
173 | } | ||
174 | } else if (sk->sk_protocol != IPPROTO_TCP) | ||
170 | break; | 175 | break; |
171 | 176 | ||
172 | if (sk->sk_state != TCP_ESTABLISHED) { | 177 | if (sk->sk_state != TCP_ESTABLISHED) { |