Skip to content

Commit 91f89fe

Browse files
pipchugregkh
authored andcommitted
tcp/dccp: allow a connection when sk_max_ack_backlog is zero
[ Upstream commit 3479c75 ] If the backlog of listen() is set to zero, sk_acceptq_is_full() allows one connection to be made, but inet_csk_reqsk_queue_is_full() does not. When the net.ipv4.tcp_syncookies is zero, inet_csk_reqsk_queue_is_full() will cause an immediate drop before the sk_acceptq_is_full() check in tcp_conn_request(), resulting in no connection can be made. This patch tries to keep consistent with 64a1465 ("[NET]: Revert incorrect accept queue backlog changes."). Link: https://lore.kernel.org/netdev/[email protected]/ Fixes: ef547f2 ("tcp: remove max_qlen_log") Signed-off-by: Zhongqiu Duan <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Jason Xing <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent b2c9204 commit 91f89fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/inet_connection_sock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static inline int inet_csk_reqsk_queue_len(const struct sock *sk)
282282

283283
static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk)
284284
{
285-
return inet_csk_reqsk_queue_len(sk) >= READ_ONCE(sk->sk_max_ack_backlog);
285+
return inet_csk_reqsk_queue_len(sk) > READ_ONCE(sk->sk_max_ack_backlog);
286286
}
287287

288288
bool inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req);

0 commit comments

Comments
 (0)