From: Maria Matejka Date: Sun, 7 May 2023 19:19:15 +0000 (+0200) Subject: Temporary hash function update X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=478912c558f74313140878c42df9a73f841951bc;p=thirdparty%2Fbird.git Temporary hash function update --- diff --git a/lib/ip.h b/lib/ip.h index 20e7a3363..175f889fb 100644 --- a/lib/ip.h +++ b/lib/ip.h @@ -199,9 +199,11 @@ static inline u32 ip4_hash(ip4_addr a) static inline u32 ip6_hash(ip6_addr a) { - /* Returns a 32-bit hash key, although low-order bits are not mixed */ - u32 x = _I0(a) ^ _I1(a) ^ _I2(a) ^ _I3(a); - return x ^ (x << 16) ^ (x << 24); + return + u32_hash(_I0(a)) ^ + u32_hash(_I1(a)) ^ + u32_hash(_I2(a)) ^ + u32_hash(_I3(a)); } static inline int ip4_compare(ip4_addr a, ip4_addr b)