Skip to content

Commit

Permalink
net: correct sk_acceptq_is_full()
Browse files Browse the repository at this point in the history
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 <yacanliu@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
liuyacan authored and David S. Miller committed Mar 12, 2021
1 parent 080bfa1 commit f211ac1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit f211ac1

Please sign in to comment.