diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c index 40829111fe00..273c921751e4 100644 --- a/net/core/sock_reuseport.c +++ b/net/core/sock_reuseport.c @@ -302,7 +302,7 @@ struct sock *reuseport_select_sock(struct sock *sk, i = j = reciprocal_scale(hash, socks); while (reuse->socks[i]->sk_state == TCP_ESTABLISHED) { i++; - if (i >= reuse->num_socks) + if (i >= socks) i = 0; if (i == j) goto out;