]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Temporary hash function update
authorMaria Matejka <mq@ucw.cz>
Sun, 7 May 2023 19:19:15 +0000 (21:19 +0200)
committerMaria Matejka <mq@ucw.cz>
Sun, 7 May 2023 19:19:15 +0000 (21:19 +0200)
lib/ip.h

index 20e7a33633bd12373eaf64eda0eac2ca435c0ea4..175f889fb4a76980c4633955c15bec5e9c254d88 100644 (file)
--- 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)