diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-19 17:01:11 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-21 04:31:08 +0200 |
commit | a6c869b49eed2a83a63c9f1247a61455a6ec1358 (patch) | |
tree | 407cb4de9cef0ea04bb6e876db15381e112315a7 /src | |
parent | 996511c7664fb4bdd2cf9d4d81e935863557ae3a (diff) |
cookie: move the bangs
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/cookie.c | 4 |
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); |