Re: [PATCH bpf-next v6 4/8] net: remove duplicate reuseport_lookup functions

From: Martin KaFai Lau
Date: Mon Jul 24 2023 - 19:02:23 EST


On 7/20/23 8:30 AM, Lorenz Bauer wrote:
@@ -452,7 +436,14 @@ static struct sock *udp4_lib_lookup2(struct net *net,
daddr, hnum, dif, sdif);
if (score > badness) {
badness = score;
- result = lookup_reuseport(net, sk, skb, saddr, sport, daddr, hnum);
+
+ if (sk->sk_state == TCP_ESTABLISHED) {
+ result = sk;
+ continue;
+ }

Thanks for the cleanup. I also found moving the TCP_ESTABLISHED check here made the score logic easier to reason.