Skip to content

Commit

Permalink
tcp: fix possible socket refcount problem for ipv6
Browse files Browse the repository at this point in the history
commit 144d56e
("tcp: fix possible socket refcount problem") is missing
the IPv6 part. As tcp_release_cb is shared by both protocols
we should hold sock reference for the TCP_MTU_REDUCED_DEFERRED
bit.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Julian Anastasov authored and David S. Miller committed Sep 5, 2012
1 parent 463dde1 commit d013ef2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,9 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
tp->mtu_info = ntohl(info);
if (!sock_owned_by_user(sk))
tcp_v6_mtu_reduced(sk);
else
set_bit(TCP_MTU_REDUCED_DEFERRED, &tp->tsq_flags);
else if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED,
&tp->tsq_flags))
sock_hold(sk);
goto out;
}

Expand Down

0 comments on commit d013ef2

Please sign in to comment.