summaryrefslogtreecommitdiffhomepage
path: root/src/send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/send.c b/src/send.c
index 3baae7f..700749c 100644
--- a/src/send.c
+++ b/src/send.c
@@ -169,6 +169,11 @@ static bool encrypt_packet(struct sk_buff *skb, struct noise_keypair *keypair,
struct sk_buff *trailer;
int num_frags;
+ /* Force hash calculation before encryption so that flow analysis is
+ * consistent over the inner packet.
+ */
+ skb_get_hash(skb);
+
/* Calculate lengths. */
padding_len = calculate_skb_padding(skb);
trailer_len = padding_len + noise_encrypted_len(0);
@@ -301,7 +306,7 @@ void wg_packet_encrypt_worker(struct work_struct *work)
if (likely(encrypt_packet(skb,
PACKET_CB(first)->keypair,
&simd_context))) {
- wg_reset_packet(skb);
+ wg_reset_packet(skb, true);
} else {
state = PACKET_STATE_DEAD;
break;