[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1450397651.8474.110.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Thu, 17 Dec 2015 16:14:11 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>,
Lorenzo Colitti <lorenzo@...gle.com>
Subject: [PATCH net-next] tcp: diag: add support for request sockets to
tcp_abort()
From: Eric Dumazet <edumazet@...gle.com>
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.
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
Cc: Lorenzo Colitti <lorenzo@...gle.com>
---
net/ipv4/tcp.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 2c0e340518d2..cc7aaa507abf 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3083,6 +3083,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;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists