aboutsummaryrefslogtreecommitdiffstats
path: root/src/wg_noise.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-04-22 00:13:28 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2021-04-22 00:38:40 -0600
commit2e200c8cf3963a1bd8b754eb0654df91fc8a8e77 (patch)
tree77168c3b281b7d70ba45b2f6911298b95fcb4c79 /src/wg_noise.c
parentif_wg: more thorough wg_mbuf_reset (diff)
downloadwireguard-freebsd-2e200c8cf3963a1bd8b754eb0654df91fc8a8e77.tar.xz
wireguard-freebsd-2e200c8cf3963a1bd8b754eb0654df91fc8a8e77.zip
global: add missing brackets
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/wg_noise.c')
-rw-r--r--src/wg_noise.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wg_noise.c b/src/wg_noise.c
index b996d3b..b188ece 100644
--- a/src/wg_noise.c
+++ b/src/wg_noise.c
@@ -389,9 +389,10 @@ noise_remote_index_insert(struct noise_local *l, struct noise_remote *r)
assign_id:
r_i->i_local_index = arc4random();
idx = r_i->i_local_index & HT_INDEX_MASK;
- CK_LIST_FOREACH(i, &l->l_index_hash[idx], i_entry)
+ CK_LIST_FOREACH(i, &l->l_index_hash[idx], i_entry) {
if (i->i_local_index == r_i->i_local_index)
goto assign_id;
+ }
rw_wlock(&l->l_index_lock);
CK_LIST_FOREACH(i, &l->l_index_hash[idx], i_entry) {