From a6f250f5c6d079badc4a1274b19a21a52de6acec Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 20 Dec 1998 13:57:49 +0000 Subject: 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. --- lib/ipv6.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ipv6.h') diff --git a/lib/ipv6.h b/lib/ipv6.h index 1cf52a9..b8d2e9f 100644 --- a/lib/ipv6.h +++ b/lib/ipv6.h @@ -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 -- cgit v1.2.3