aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/cookie.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-04-19 17:01:11 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-04-21 04:31:08 +0200
commita6c869b49eed2a83a63c9f1247a61455a6ec1358 (patch)
tree407cb4de9cef0ea04bb6e876db15381e112315a7 /src/cookie.c
parenttools: no hyphen in preshared, to keep uniformity (diff)
downloadwireguard-linux-compat-a6c869b49eed2a83a63c9f1247a61455a6ec1358.tar.xz
wireguard-linux-compat-a6c869b49eed2a83a63c9f1247a61455a6ec1358.zip
cookie: move the bangs
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/cookie.c')
-rw-r--r--src/cookie.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cookie.c b/src/cookie.c
index 66f5d45..6ecc02a 100644
--- a/src/cookie.c
+++ b/src/cookie.c
@@ -32,7 +32,7 @@ static int precompute_peer_key(struct wireguard_peer *peer, void *psk)
void cookie_checker_precompute_keys(struct cookie_checker *checker, struct wireguard_peer *peer)
{
down_read(&checker->device->static_identity.lock);
- if (unlikely(checker->device->static_identity.has_identity)) {
+ if (unlikely(!checker->device->static_identity.has_identity)) {
memset(checker->cookie_encryption_key, 0, NOISE_SYMMETRIC_KEY_LEN);
goto out;
}
@@ -188,7 +188,7 @@ void cookie_message_consume(struct message_handshake_cookie *src, struct wiregua
bool ret;
entry = index_hashtable_lookup(&wg->index_hashtable, INDEX_HASHTABLE_HANDSHAKE | INDEX_HASHTABLE_KEYPAIR, src->receiver_index);
- if (!unlikely(entry))
+ if (unlikely(!entry))
return;
down_read(&entry->peer->latest_cookie.lock);