diff options
Diffstat (limited to 'src/hashtables.c')
-rw-r--r-- | src/hashtables.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hashtables.c b/src/hashtables.c index ee55b8e..14baf5b 100644 --- a/src/hashtables.c +++ b/src/hashtables.c @@ -14,9 +14,9 @@ static struct hlist_head *pubkey_bucket(struct pubkey_hashtable *table, * the bits are uniformly distributed, we can then mask off to get the * bits we need. */ - return &table->hashtable[ - siphash(pubkey, NOISE_PUBLIC_KEY_LEN, &table->key) & - (HASH_SIZE(table->hashtable) - 1)]; + const u64 hash = siphash(pubkey, NOISE_PUBLIC_KEY_LEN, &table->key); + + return &table->hashtable[hash & (HASH_SIZE(table->hashtable) - 1)]; } void wg_pubkey_hashtable_init(struct pubkey_hashtable *table) |