summaryrefslogtreecommitdiff
path: root/nest/rt-attr.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2015-12-24 15:52:03 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2015-12-24 15:56:04 +0100
commit04632fd77f291f67753341d12d540f7dac341bd3 (patch)
tree94b319a0fe0e312539857e76e0b9d6982ce81555 /nest/rt-attr.c
parent70b90dde23a684c4d32aa53685f76a73ecba941d (diff)
Follow-up work on integration
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r--nest/rt-attr.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index 7fa05d6d..d100c537 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -195,10 +195,10 @@ rt_prune_sources(void)
* Multipath Next Hop
*/
-static inline uint
+static inline u32
mpnh_hash(struct mpnh *x)
{
- uint h = 0;
+ u32 h = 0;
for (; x; x = x->next)
h ^= ipa_hash(x->gw);
@@ -1008,8 +1008,9 @@ rta_alloc_hash(void)
static inline uint
rta_hash(rta *a)
{
- return (((uint) (uintptr_t) a->src) ^ ipa_hash(a->gw) ^
- mpnh_hash(a->nexthops) ^ ea_hash(a->eattrs)) & 0xffff;
+ /* XXXX fully convert to u32 hashing */
+ return (((uint) (uintptr_t) a->src) ^ (ipa_hash(a->gw) >> 16) ^
+ (mpnh_hash(a->nexthops) >> 16) ^ ea_hash(a->eattrs)) & 0xffff;
}
static inline int