summaryrefslogtreecommitdiffhomepage
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
commit113faae1721bf918cb6993e13752063f73f0b173 (patch)
tree3c1299478c7b6156a77a4db67a7a093f320505ca /src/hashtables.c
parent323636085e1a6c063818a697b30e074578db258e (diff)
global: add space around variable declarations
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/hashtables.c')
-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) {