[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFmV8Nc758FDNK3FNSLQui4RmE3-TQr7d2tM_tOM6bC=OfEDwQ@mail.gmail.com>
Date: Tue, 31 Dec 2024 16:24:31 +0800
From: Zhongqiu Duan <dzq.aishenghu0@...il.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com
Subject: perhaps inet_csk_reqsk_queue_is_full should also allow zero backlog
Hi all,
We use a proprietary library in our product, it passes hardcoded zero
as the backlog of listen().
It works fine when syncookies is enabled, but when we disable syncookies
by business requirement, no connection can be made.
After some investigation, the problem is focused on the
inet_csk_reqsk_queue_is_full().
static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk)
{
return inet_csk_reqsk_queue_len(sk) >=
READ_ONCE(sk->sk_max_ack_backlog);
}
I noticed that the stories happened to sk_acceptq_is_full() about this
in the past, like
the commit c609e6a (Revert "net: correct sk_acceptq_is_full()").
Perhaps we can also avoid the problem by using ">" in the decision
condition like
`inet_csk_reqsk_queue_len(sk) > READ_ONCE(sk->sk_max_ack_backlog)`.
Best regards,
Zhongqiu
Powered by blists - more mailing lists