diff options
author | Jan Maria Matejka <mq@ucw.cz> | 2018-10-30 15:25:32 +0100 |
---|---|---|
committer | Jan Maria Matejka <mq@ucw.cz> | 2018-12-04 14:00:28 +0100 |
commit | 84661bf6da683d70e6e5e0e490d95abaf91b470b (patch) | |
tree | 931c683802693265fed83e0dd828ea60f5d086c4 /lib/ip.h | |
parent | 14375237f6901a926d59cc54870cf44ed2a61d20 (diff) |
Changed IPv4 hash function to simple multiplication.
Diffstat (limited to 'lib/ip.h')
-rw-r--r-- | lib/ip.h | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -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) { |