UPSTREAM: Revert "udp: Improve load balancing for SO_REUSEPORT."

This reverts commit df89c1ee03.

Change-Id: If65d5183f3e2a756e42106f7cde1fdabb8c2d2c1
This commit is contained in:
basamaryan 2025-11-22 00:52:53 +01:00
commit bf3692284b
No known key found for this signature in database
GPG key ID: 210D5384FB2A5885
2 changed files with 12 additions and 18 deletions

View file

@ -417,7 +417,7 @@ static struct sock *udp4_lib_lookup2(struct net *net,
struct udp_hslot *hslot2,
struct sk_buff *skb)
{
struct sock *sk, *result, *reuseport_result;
struct sock *sk, *result;
int score, badness;
u32 hash = 0;
@ -427,20 +427,17 @@ static struct sock *udp4_lib_lookup2(struct net *net,
score = compute_score(sk, net, saddr, sport,
daddr, hnum, dif, sdif);
if (score > badness) {
reuseport_result = NULL;
if (sk->sk_reuseport &&
sk->sk_state != TCP_ESTABLISHED) {
hash = udp_ehashfn(net, daddr, hnum,
saddr, sport);
reuseport_result = reuseport_select_sock(sk, hash, skb,
sizeof(struct udphdr));
if (reuseport_result && !reuseport_has_conns(sk, false))
return reuseport_result;
result = reuseport_select_sock(sk, hash, skb,
sizeof(struct udphdr));
if (result && !reuseport_has_conns(sk, false))
return result;
}
result = reuseport_result ? : sk;
badness = score;
result = sk;
}
}
return result;