]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Changed IPv4 hash function to simple multiplication.
authorJan Maria Matejka <mq@ucw.cz>
Tue, 30 Oct 2018 14:25:32 +0000 (15:25 +0100)
committerJan Maria Matejka <mq@ucw.cz>
Tue, 4 Dec 2018 13:00:28 +0000 (14:00 +0100)
lib/ip.h

index cc6be384b16216abe82370c9717843b9c3b70041..b78a5e228e0c96502e2304de260ff009ceea2fef 100644 (file)
--- a/lib/ip.h
+++ b/lib/ip.h
@@ -186,13 +186,7 @@ static inline int ipa_nonzero2(ip_addr a)
  */
 
 static inline u32 ip4_hash(ip4_addr a)
-{
-  /* Returns a 32-bit value, although low-order bits are not mixed */
-  u32 x = _I(a);
-  x ^= x << 16;
-  x ^= x << 12;
-  return x;
-}
+{ return u32_hash(_I(a)); }
 
 static inline u32 ip6_hash(ip6_addr a)
 {