]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
udp: Remove dead check in __udp[46]_lib_lookup() for BPF.
authorKuniyuki Iwashima <kuniyu@google.com>
Wed, 11 Mar 2026 05:19:59 +0000 (05:19 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 14 Mar 2026 01:57:45 +0000 (18:57 -0700)
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 <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260311052020.1213705-13-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/udp.c
net/ipv6/udp.c

index 14b372b211be663751cc427a86663a4910241292..fd0bad44d111f6e474989b786508ad55191da224 100644 (file)
@@ -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);
index eeb77363a55666e365cfd3e6f913be9d92abbfe2..5ba399218d0730344105fe5416eba0910729e4e5 100644 (file)
@@ -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);