net: do not send reset to already closed tcp sockets This adds an additional check in tcp_close() for already closed sockets. We do not want to send anything to closed sockets. Signed-off-by: Konstantin Khorenko --- --- ./net/ipv4/tcp.c.reset 2010-05-17 01:17:36.000000000 +0400 +++ ./net/ipv4/tcp.c 2010-06-17 16:42:11.000000000 +0400 @@ -1898,6 +1898,10 @@ void tcp_close(struct sock *sk, long tim sk_mem_reclaim(sk); + /* If socket has been already reset (e.g. in tcp_reset()) - kill it. */ + if (sk->sk_state == TCP_CLOSE) + goto adjudge_to_death; + /* As outlined in RFC 2525, section 2.17, we send a RST here because * data was lost. To witness the awful effects of the old behavior of * always doing a FIN, run an older 2.1.x kernel or 2.0.x, start a bulk