]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tcp: use __jhash_final() in inet6_ehashfn()
authorEric Dumazet <edumazet@google.com>
Fri, 27 Mar 2026 04:06:46 +0000 (04:06 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sun, 29 Mar 2026 18:45:48 +0000 (11:45 -0700)
commit02d0e59e36e06fb728eb4dea8479f502c67b9fbc
treef0b79435b9274910a7231c398499a751dbf4b1bd
parent30fcf28d83ee30494454b3f62f89a86e9e67bc25
tcp: use __jhash_final() in inet6_ehashfn()

I misread jhash2() implementation.

Last round should use __jhash_final() instead of __jhash_mix().

Using __jhash_mix() here leaves entropy distributed across a, b, and c,
which might lead to incomplete diffusion of the faddr and fport bits
into the bucket index. Replacing this last __jhash_mix() with
__jhash_final() provides the correct avalanche properties
for the returned value in c.

$ scripts/bloat-o-meter -t vmlinux.0 vmlinux
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-4 (-4)
Function                                     old     new   delta
inet6_ehashfn                                306     302      -4
Total: Before=25155089, After=25155085, chg -0.00%

Fixes: 854587e69ef3 ("tcp: improve inet6_ehashfn() entropy")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260327040646.3849503-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/inet6_hashtables.c