summaryrefslogtreecommitdiff
path: root/nest/rt-attr.c
diff options
context:
space:
mode:
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