From: Jan Maria Matejka Date: Tue, 30 Oct 2018 14:25:32 +0000 (+0100) Subject: Changed IPv4 hash function to simple multiplication. X-Git-Tag: v2.0.3~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84661bf6da683d70e6e5e0e490d95abaf91b470b;p=thirdparty%2Fbird.git Changed IPv4 hash function to simple multiplication. --- diff --git a/lib/ip.h b/lib/ip.h index cc6be384b..b78a5e228 100644 --- 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) {