aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit06099be8610d9b1ee8ad34165cf5f24fa0c0ec55 (patch)
tree5e6aa524acc5c127eb7ef5d251c01afd33d352b4 /src/hashtables.h
parentgo test: use x/crypto for blake2s now that we have 128-bit mac (diff)
downloadwireguard-monolithic-historical-06099be8610d9b1ee8ad34165cf5f24fa0c0ec55.tar.xz
wireguard-monolithic-historical-06099be8610d9b1ee8ad34165cf5f24fa0c0ec55.zip
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>
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);