mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
tcp: diag: add support for request sockets to tcp_abort()
Adding support for SYN_RECV request sockets to tcp_abort()
is quite easy after our tcp listener rewrite.
Note that we also need to better handle listeners, or we might
leak not yet accepted children, because of a missing
inet_csk_listen_stop() call.
[cherry-pick of net-next 07f6f4a31e]
Change-Id: I8ec6b2e6ec24f330a69595abf1d5469ace79b3fd
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Lorenzo Colitti <lorenzo@google.com>
Tested-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
Amit Pundir
parent
69f0e89f55
commit
2a5cf317a1
@@ -3104,6 +3104,15 @@ EXPORT_SYMBOL_GPL(tcp_done);
|
||||
int tcp_abort(struct sock *sk, int err)
|
||||
{
|
||||
if (!sk_fullsock(sk)) {
|
||||
if (sk->sk_state == TCP_NEW_SYN_RECV) {
|
||||
struct request_sock *req = inet_reqsk(sk);
|
||||
|
||||
local_bh_disable();
|
||||
inet_csk_reqsk_queue_drop_and_put(req->rsk_listener,
|
||||
req);
|
||||
local_bh_enable();
|
||||
return 0;
|
||||
}
|
||||
sock_gen_put(sk);
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user