summaryrefslogtreecommitdiff
path: root/include/net/request_sock.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-10-14 21:16:28 +0300
committerDavid S. Miller <davem@davemloft.net>2015-10-16 10:52:19 +0300
commitebb516af60e18258aac8e80bbe068740ef1579ed (patch)
treebf2c3efa6f72141e1824bcd075fcfcc250475476 /include/net/request_sock.h
parentf03f2e154f52fdaa982de7e2c386737679963dc9 (diff)
downloadlinux-ebb516af60e18258aac8e80bbe068740ef1579ed.tar.xz
tcp/dccp: fix race at listener dismantle phase
Under stress, a close() on a listener can trigger the WARN_ON(sk->sk_ack_backlog) in inet_csk_listen_stop() We need to test if listener is still active before queueing a child in inet_csk_reqsk_queue_add() Create a common inet_child_forget() helper, and use it from inet_csk_reqsk_queue_add() and inet_csk_listen_stop() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/request_sock.h')
-rw-r--r--include/net/request_sock.h19
1 files changed, 0 insertions, 19 deletions
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index 2e73748956d5..a0dde04eb178 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -186,25 +186,6 @@ static inline bool reqsk_queue_empty(const struct request_sock_queue *queue)
return queue->rskq_accept_head == NULL;
}
-static inline void reqsk_queue_add(struct request_sock_queue *queue,
- struct request_sock *req,
- struct sock *parent,
- struct sock *child)
-{
- spin_lock(&queue->rskq_lock);
- req->sk = child;
- sk_acceptq_added(parent);
-
- if (queue->rskq_accept_head == NULL)
- queue->rskq_accept_head = req;
- else
- queue->rskq_accept_tail->dl_next = req;
-
- queue->rskq_accept_tail = req;
- req->dl_next = NULL;
- spin_unlock(&queue->rskq_lock);
-}
-
static inline struct request_sock *reqsk_queue_remove(struct request_sock_queue *queue,
struct sock *parent)
{