Re: [PATCH v4 4/4] net: diag: Support destroying TCP sockets.

2015-12-01 Thread Eric Dumazet
On Tue, 2015-12-01 at 16:04 +0900, Lorenzo Colitti wrote: > + /* Don't race with BH socket closes such as inet_csk_listen_stop. */ > + local_bh_disable(); > + bh_lock_sock(sk); > + > + if (!sock_flag(sk, SOCK_DEAD)) { > + smp_wmb(); /* Be consistent with tcp_reset */

[PATCH v4 4/4] net: diag: Support destroying TCP sockets.

2015-11-30 Thread Lorenzo Colitti
This implements SOCK_DESTROY for TCP sockets. It causes all blocking calls on the socket to fail fast with ECONNABORTED and causes a protocol close of the socket. It informs the other end of the connection by sending a RST, i.e., initiating a TCP ABORT as per RFC 793. ECONNABORTED was chosen for co