diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-06-01 06:46:25 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-06-01 06:46:25 +0200 |
commit | 61e1a8b01dca5d1d6eaa191ac9c12c240e4b2d75 (patch) | |
tree | 0210c94dfa61a9768fa996e2c793c37db7a8b6c9 /src/data.c | |
parent | go test: properly pad message (diff) | |
download | wireguard-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |