From: liuyacan Date: Thu, 11 Mar 2021 16:32:25 +0000 (+0800) Subject: net: correct sk_acceptq_is_full() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f211ac154577ec9ccf07c15f18a6abf0d9bdb4ab;p=linux.git net: correct sk_acceptq_is_full() The "backlog" argument in listen() specifies the maximom length of pending connections, so the accept queue should be considered full if there are exactly "backlog" elements. Signed-off-by: liuyacan Signed-off-by: David S. Miller --- diff --git a/include/net/sock.h b/include/net/sock.h index 636810ddcd9ba..0b6266fd6bf6f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -936,7 +936,7 @@ static inline void sk_acceptq_added(struct sock *sk) static inline bool sk_acceptq_is_full(const struct sock *sk) { - return READ_ONCE(sk->sk_ack_backlog) > READ_ONCE(sk->sk_max_ack_backlog); + return READ_ONCE(sk->sk_ack_backlog) >= READ_ONCE(sk->sk_max_ack_backlog); } /*