aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/hashtables.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-03 14:55:33 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-03 14:55:33 +0200
commit905839bff398d8ce6d050ee766413fa0c7b5d02c (patch)
tree01f377b6cf47772dd53ae87ae39b1c8b2011f03a /src/hashtables.c
parentglobal: use _WG prefix for include guards (diff)
downloadwireguard-monolithic-historical-905839bff398d8ce6d050ee766413fa0c7b5d02c.tar.xz
wireguard-monolithic-historical-905839bff398d8ce6d050ee766413fa0c7b5d02c.zip
global: add space around variable declarations
Diffstat (limited to '')
-rw-r--r--src/hashtables.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/hashtables.c b/src/hashtables.c
index 978997a..a0cfa44 100644
--- a/src/hashtables.c
+++ b/src/hashtables.c
@@ -36,6 +36,7 @@ void pubkey_hashtable_remove(struct pubkey_hashtable *table, struct wireguard_pe
struct wireguard_peer *pubkey_hashtable_lookup(struct pubkey_hashtable *table, const u8 pubkey[NOISE_PUBLIC_KEY_LEN])
{
struct wireguard_peer *iter_peer, *peer = NULL;
+
rcu_read_lock_bh();
hlist_for_each_entry_rcu_bh (iter_peer, pubkey_bucket(table, pubkey), pubkey_hash) {
if (!memcmp(pubkey, iter_peer->handshake.remote_static, NOISE_PUBLIC_KEY_LEN)) {
@@ -142,6 +143,7 @@ void index_hashtable_remove(struct index_hashtable *table, struct index_hashtabl
struct index_hashtable_entry *index_hashtable_lookup(struct index_hashtable *table, const enum index_hashtable_type type_mask, const __le32 index)
{
struct index_hashtable_entry *iter_entry, *entry = NULL;
+
rcu_read_lock_bh();
hlist_for_each_entry_rcu_bh (iter_entry, index_bucket(table, index), index_hash) {
if (iter_entry->index == index) {