Skip to content

Commit

Permalink
[IPV6]: Do not change protocol for UDPv6 sockets with pending sent data.
Browse files Browse the repository at this point in the history
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
  • Loading branch information
Denis V. Lunev authored and YOSHIFUJI Hideaki committed Jun 4, 2008
1 parent 36d926b commit 9596cc8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9596cc8

Please sign in to comment.