From: Kuniyuki Iwashima Date: Wed, 11 Mar 2026 05:19:59 +0000 (+0000) Subject: udp: Remove dead check in __udp[46]_lib_lookup() for BPF. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a88b2810f267893e4b34f3044a9e11f952f03d9;p=thirdparty%2Fkernel%2Flinux.git udp: Remove dead check in __udp[46]_lib_lookup() for BPF. BPF socket lookup for SO_REUSEPORT does not support UDP-Lite. In __udp4_lib_lookup() and __udp6_lib_lookup(), it checks if the passed udptable pointer is the same as net->ipv4.udp_table, which is only true for UDP. Now, the condition is always true. Let's remove the check. Signed-off-by: Kuniyuki Iwashima Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/20260311052020.1213705-13-kuniyu@google.com Signed-off-by: Jakub Kicinski --- diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 14b372b211be6..fd0bad44d111f 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -699,8 +699,7 @@ struct sock *__udp4_lib_lookup(const struct net *net, __be32 saddr, goto done; /* Lookup redirect from BPF */ - if (static_branch_unlikely(&bpf_sk_lookup_enabled) && - udptable == net->ipv4.udp_table) { + if (static_branch_unlikely(&bpf_sk_lookup_enabled)) { sk = inet_lookup_run_sk_lookup(net, IPPROTO_UDP, skb, sizeof(struct udphdr), saddr, sport, daddr, hnum, dif, udp_ehashfn); diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index eeb77363a5566..5ba399218d073 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -370,8 +370,7 @@ struct sock *__udp6_lib_lookup(const struct net *net, goto done; /* Lookup redirect from BPF */ - if (static_branch_unlikely(&bpf_sk_lookup_enabled) && - udptable == net->ipv4.udp_table) { + if (static_branch_unlikely(&bpf_sk_lookup_enabled)) { sk = inet6_lookup_run_sk_lookup(net, IPPROTO_UDP, skb, sizeof(struct udphdr), saddr, sport, daddr, hnum, dif, udp6_ehashfn);