summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/request_sock.c8
-rw-r--r--net/ipv4/inet_connection_sock.c4
2 files changed, 3 insertions, 9 deletions
diff --git a/net/core/request_sock.c b/net/core/request_sock.c
index ecf7418..15c8538 100644
--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -37,13 +37,8 @@
int sysctl_max_syn_backlog = 256;
EXPORT_SYMBOL(sysctl_max_syn_backlog);
-void reqsk_queue_alloc(struct request_sock_queue *queue,
- unsigned int nr_table_entries)
+void reqsk_queue_alloc(struct request_sock_queue *queue)
{
- nr_table_entries = min_t(u32, nr_table_entries, sysctl_max_syn_backlog);
- nr_table_entries = max_t(u32, nr_table_entries, 8);
- nr_table_entries = roundup_pow_of_two(nr_table_entries + 1);
-
spin_lock_init(&queue->rskq_lock);
spin_lock_init(&queue->fastopenq.lock);
@@ -53,7 +48,6 @@ void reqsk_queue_alloc(struct request_sock_queue *queue,
queue->fastopenq.max_qlen = 0;
queue->rskq_accept_head = NULL;
- queue->max_qlen_log = ilog2(nr_table_entries);
}
/*
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 7754832..5f6e31a 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -579,7 +579,7 @@ static void reqsk_timer_handler(unsigned long data)
* ones are about to clog our table.
*/
qlen = reqsk_queue_len(queue);
- if (qlen >> (queue->max_qlen_log - 1)) {
+ if ((qlen << 1) > sk_listener->sk_max_ack_backlog) {
int young = reqsk_queue_len_young(queue) << 1;
while (thresh > 2) {
@@ -732,7 +732,7 @@ int inet_csk_listen_start(struct sock *sk, const int nr_table_entries)
struct inet_connection_sock *icsk = inet_csk(sk);
struct inet_sock *inet = inet_sk(sk);
- reqsk_queue_alloc(&icsk->icsk_accept_queue, nr_table_entries);
+ reqsk_queue_alloc(&icsk->icsk_accept_queue);
sk->sk_max_ack_backlog = 0;
sk->sk_ack_backlog = 0;