summaryrefslogtreecommitdiffhomepage
path: root/src/hashtables.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hashtables.c')
-rw-r--r--src/hashtables.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hashtables.c b/src/hashtables.c
index f0d8769..f30f6cf 100644
--- a/src/hashtables.c
+++ b/src/hashtables.c
@@ -68,7 +68,7 @@ void index_hashtable_init(struct index_hashtable *table)
__le32 index_hashtable_insert(struct index_hashtable *table, struct index_hashtable_entry *entry)
{
struct index_hashtable_entry *existing_entry;
- unsigned long rand = get_random_long();
+ uint64_t rand;
spin_lock(&table->lock);
hlist_del_init_rcu(&entry->index_hash);
@@ -78,7 +78,7 @@ __le32 index_hashtable_insert(struct index_hashtable *table, struct index_hashta
search_unused_slot:
/* First we try to find an unused slot, randomly, while unlocked. */
- ++rand;
+ rand = get_random_long();
entry->index = (__force __le32)siphash24((uint8_t *)&rand, sizeof(rand), table->key);
hlist_for_each_entry_rcu(existing_entry, index_bucket(table, entry->index), index_hash) {
if (existing_entry->index == entry->index)