diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2015-12-24 15:52:03 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2015-12-24 15:56:04 +0100 |
commit | 04632fd77f291f67753341d12d540f7dac341bd3 (patch) | |
tree | 94b319a0fe0e312539857e76e0b9d6982ce81555 /nest/neighbor.c | |
parent | 70b90dde23a684c4d32aa53685f76a73ecba941d (diff) |
Follow-up work on integration
Diffstat (limited to 'nest/neighbor.c')
-rw-r--r-- | nest/neighbor.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nest/neighbor.c b/nest/neighbor.c index 5b525fa9..74c3c664 100644 --- a/nest/neighbor.c +++ b/nest/neighbor.c @@ -45,6 +45,7 @@ #include "lib/resource.h" #define NEIGH_HASH_SIZE 256 +#define NEIGH_HASH_OFFSET 24 static slab *neigh_slab; static list sticky_neigh_list, neigh_hash_table[NEIGH_HASH_SIZE]; @@ -52,7 +53,7 @@ static list sticky_neigh_list, neigh_hash_table[NEIGH_HASH_SIZE]; static inline uint neigh_hash(struct proto *p, ip_addr *a) { - return (p->hash_key ^ ipa_hash(*a)) & (NEIGH_HASH_SIZE-1); + return (p->hash_key ^ ipa_hash(*a)) >> NEIGH_HASH_OFFSET; } static int |