net: diag: Support destroying TCP sockets.
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 consistency with FreeBSD. Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
6eb5d2e08f
commit
c1e64e298b
@@ -1170,6 +1170,8 @@ void tcp_set_state(struct sock *sk, int state);
|
||||
|
||||
void tcp_done(struct sock *sk);
|
||||
|
||||
int tcp_abort(struct sock *sk, int err);
|
||||
|
||||
static inline void tcp_sack_reset(struct tcp_options_received *rx_opt)
|
||||
{
|
||||
rx_opt->dsack = 0;
|
||||
|
Reference in New Issue
Block a user