diff options
author | Martin Mares <mj@ucw.cz> | 1998-12-20 13:57:49 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1998-12-20 13:57:49 +0000 |
commit | a6f250f5c6d079badc4a1274b19a21a52de6acec (patch) | |
tree | 0a8fde53fead5ee11b88af0156ba2555f7cc6d3e /lib/ipv6.h | |
parent | a05406e69c699c8b6f43bf58f47b8b0385113083 (diff) |
New hash functions according to benchmarks posted yesterday. (The IPv6
version has not been benchmarked yet due to insufficient test data.)
Now ipa_hash() returns a uniformely distributed 16-bit value.
Diffstat (limited to 'lib/ipv6.h')
-rw-r--r-- | lib/ipv6.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -59,7 +59,7 @@ void ipv6_ntoh(ip_addr *); static inline unsigned ipv6_hash(ip_addr *a) { u32 x = _I0(*a) ^ _I1(*a) ^ _I2(*a) ^ _I3(*a); - return x ^ (x >> 16) ^ (x >> 8); + return (x ^ (x >> 16) ^ (x >> 8)) & 0xffff; } #endif |