SIGN IN SIGN UP

net/traffic: fix rendezvous hashing (#20828)

The rendezvous hasher for traffic steering loadbalancing was flawed.
By plainly using the FNV-1a hash value, the result often reflected the
magnitude of the most significant bits in the hash seed, meaning the
hash function was not diffusive (aka missing the Avalanche Effect).

Popular wisdom seems to be that the output of FNV-1a should be mixed
with some large numbers to perturb more output bits. Borrow concepts
from other (Rust, Java) libraries by using the mix13 variant of 64-bit
finalizers by David Stafford.

Modify the fuzz test that asserts this fairness. Adjust a few
constants like client count and candidate count to more closely
reflect real-world scenarios and practical probabilities. Tighten
the bounds for distribution from 50% to +-20%.

Updates tailscale/corp#46471

Signed-off-by: Amal Bansode <amal@tailscale.com>
A
Amal Bansode committed
fd07b9a2b679898035e8a9f202e751302e6338c3
Parent: 5e7f189
Committed by GitHub <noreply@github.com> on 8/12/2026, 9:13:42 PM