summaryrefslogtreecommitdiffhomepage
path: root/src/hashtables.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-06-06 21:49:29 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-06-08 04:24:13 +0200
commitf2ce3e868c91cb84819eb89019484301feffe87d (patch)
treed3562e7233346f1904ec58ae9bc7292f11b13d79 /src/hashtables.h
parentd93bc3aa7ee43f11786432148f3ac81f594790ec (diff)
noise: fix race when replacing handshake
Replacing an entry that's already been replaced is something that could happen when processing handshake messages in parallel, when starting up multiple instances on the same machine. Reported-by: Hubert Goisern <zweizweizwoelf@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/hashtables.h')
-rw-r--r--src/hashtables.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hashtables.h b/src/hashtables.h
index 9fa47d5..08a2a5d 100644
--- a/src/hashtables.h
+++ b/src/hashtables.h
@@ -40,7 +40,7 @@ struct index_hashtable_entry {
};
void index_hashtable_init(struct index_hashtable *table);
__le32 index_hashtable_insert(struct index_hashtable *table, struct index_hashtable_entry *entry);
-void index_hashtable_replace(struct index_hashtable *table, struct index_hashtable_entry *old, struct index_hashtable_entry *new);
+bool index_hashtable_replace(struct index_hashtable *table, struct index_hashtable_entry *old, struct index_hashtable_entry *new);
void index_hashtable_remove(struct index_hashtable *table, struct index_hashtable_entry *entry);
struct index_hashtable_entry *index_hashtable_lookup(struct index_hashtable *table, const enum index_hashtable_type type_mask, const __le32 index);