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

tcp: Remove hashinfo test for inet6?_lookup_run_sk_lookup().

Commit 6c886db2e78c ("net: remove duplicate sk_lookup helpers")
started to check if hashinfo == net->ipv4.tcp_death_row.hashinfo
in __inet_lookup_listener() and inet6_lookup_listener() and
stopped invoking BPF sk_lookup prog for DCCP.

DCCP has gone and the condition is always true.

Let's remove the hashinfo test.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250822190803.540788-4-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kuniyuki Iwashima and committed by
Jakub Kicinski
8150f3a4 2d842b6c

+2 -4
+1 -2
net/ipv4/inet_hashtables.c
··· 436 436 unsigned int hash2; 437 437 438 438 /* Lookup redirect from BPF */ 439 - if (static_branch_unlikely(&bpf_sk_lookup_enabled) && 440 - hashinfo == net->ipv4.tcp_death_row.hashinfo) { 439 + if (static_branch_unlikely(&bpf_sk_lookup_enabled)) { 441 440 result = inet_lookup_run_sk_lookup(net, IPPROTO_TCP, skb, doff, 442 441 saddr, sport, daddr, hnum, dif, 443 442 inet_ehashfn);
+1 -2
net/ipv6/inet6_hashtables.c
··· 211 211 unsigned int hash2; 212 212 213 213 /* Lookup redirect from BPF */ 214 - if (static_branch_unlikely(&bpf_sk_lookup_enabled) && 215 - hashinfo == net->ipv4.tcp_death_row.hashinfo) { 214 + if (static_branch_unlikely(&bpf_sk_lookup_enabled)) { 216 215 result = inet6_lookup_run_sk_lookup(net, IPPROTO_TCP, skb, doff, 217 216 saddr, sport, daddr, hnum, dif, 218 217 inet6_ehashfn);