Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <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>

authored by

Kuniyuki Iwashima and committed by
Jakub Kicinski
5a88b281 c570bd25

+2 -4
+1 -2
net/ipv4/udp.c
··· 699 699 goto done; 700 700 701 701 /* Lookup redirect from BPF */ 702 - if (static_branch_unlikely(&bpf_sk_lookup_enabled) && 703 - udptable == net->ipv4.udp_table) { 702 + if (static_branch_unlikely(&bpf_sk_lookup_enabled)) { 704 703 sk = inet_lookup_run_sk_lookup(net, IPPROTO_UDP, skb, sizeof(struct udphdr), 705 704 saddr, sport, daddr, hnum, dif, 706 705 udp_ehashfn);
+1 -2
net/ipv6/udp.c
··· 370 370 goto done; 371 371 372 372 /* Lookup redirect from BPF */ 373 - if (static_branch_unlikely(&bpf_sk_lookup_enabled) && 374 - udptable == net->ipv4.udp_table) { 373 + if (static_branch_unlikely(&bpf_sk_lookup_enabled)) { 375 374 sk = inet6_lookup_run_sk_lookup(net, IPPROTO_UDP, skb, sizeof(struct udphdr), 376 375 saddr, sport, daddr, hnum, dif, 377 376 udp6_ehashfn);