mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 07:31:54 +00:00
Temporary hash function update
This commit is contained in:
parent
69c22818fb
commit
478912c558
8
lib/ip.h
8
lib/ip.h
@ -199,9 +199,11 @@ static inline u32 ip4_hash(ip4_addr a)
|
|||||||
|
|
||||||
static inline u32 ip6_hash(ip6_addr a)
|
static inline u32 ip6_hash(ip6_addr a)
|
||||||
{
|
{
|
||||||
/* Returns a 32-bit hash key, although low-order bits are not mixed */
|
return
|
||||||
u32 x = _I0(a) ^ _I1(a) ^ _I2(a) ^ _I3(a);
|
u32_hash(_I0(a)) ^
|
||||||
return x ^ (x << 16) ^ (x << 24);
|
u32_hash(_I1(a)) ^
|
||||||
|
u32_hash(_I2(a)) ^
|
||||||
|
u32_hash(_I3(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ip4_compare(ip4_addr a, ip4_addr b)
|
static inline int ip4_compare(ip4_addr a, ip4_addr b)
|
||||||
|
Loading…
Reference in New Issue
Block a user