From a6c869b49eed2a83a63c9f1247a61455a6ec1358 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 19 Apr 2017 17:01:11 +0200 Subject: cookie: move the bangs Signed-off-by: Jason A. Donenfeld --- src/cookie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cookie.c') 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); -- cgit v1.2.3