summaryrefslogtreecommitdiffhomepage
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
commit0f6f08010228c2b4d3a38c66f8e9cfd1d23ad5f3 (patch)
treec9bf451c20cbd942880e781952b15d6bf268bb92 /src/data.c
parent0ee5757d36ef3ef02646e34eb465b52a33fa910d (diff)
receive: trim incoming packets to IP header length
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
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)