aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/data.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-06-01 06:46:25 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-06-01 06:46:25 +0200
commit61e1a8b01dca5d1d6eaa191ac9c12c240e4b2d75 (patch)
tree0210c94dfa61a9768fa996e2c793c37db7a8b6c9 /src/data.c
parentgo test: properly pad message (diff)
downloadwireguard-monolithic-historical-61e1a8b01dca5d1d6eaa191ac9c12c240e4b2d75.tar.xz
wireguard-monolithic-historical-61e1a8b01dca5d1d6eaa191ac9c12c240e4b2d75.zip
receive: trim incoming packets to IP header length
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c
index 9210304..d7f9332 100644
--- a/src/data.c
+++ b/src/data.c
@@ -192,7 +192,7 @@ static inline bool skb_decrypt(struct sk_buff *skb, struct noise_symmetric_key *
if (!chacha20poly1305_decrypt_sg(sg, sg, skb->len, NULL, 0, PACKET_CB(skb)->nonce, key->key))
return false;
- return pskb_trim(skb, skb->len - noise_encrypted_len(0)) == 0;
+ return !pskb_trim(skb, skb->len - noise_encrypted_len(0));
}
static inline bool get_encryption_nonce(u64 *nonce, struct noise_symmetric_key *key)