diff options
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -126,7 +126,7 @@ static inline unsigned int skb_padding(struct sk_buff *skb) return padded_size - last_unit; } -static inline bool skb_encrypt(struct sk_buff *skb, struct noise_keypair *keypair, bool have_simd) +static inline bool skb_encrypt(struct sk_buff *skb, struct noise_keypair *keypair, simd_context_t simd_context) { struct scatterlist sg[MAX_SKB_FRAGS * 2 + 1]; struct message_data *header; @@ -167,7 +167,7 @@ static inline bool skb_encrypt(struct sk_buff *skb, struct noise_keypair *keypai sg_init_table(sg, num_frags); if (skb_to_sgvec(skb, sg, sizeof(struct message_data), noise_encrypted_len(plaintext_len)) <= 0) return false; - return chacha20poly1305_encrypt_sg(sg, sg, plaintext_len, NULL, 0, PACKET_CB(skb)->nonce, keypair->sending.key, have_simd); + return chacha20poly1305_encrypt_sg(sg, sg, plaintext_len, NULL, 0, PACKET_CB(skb)->nonce, keypair->sending.key, simd_context); } void packet_send_keepalive(struct wireguard_peer *peer) @@ -243,13 +243,13 @@ void packet_encrypt_worker(struct work_struct *work) { struct crypt_queue *queue = container_of(work, struct multicore_worker, work)->ptr; struct sk_buff *first, *skb, *next; - bool have_simd = simd_get(); + simd_context_t simd_context = simd_get(); while ((first = ptr_ring_consume_bh(&queue->ring)) != NULL) { enum packet_state state = PACKET_STATE_CRYPTED; skb_walk_null_queue_safe(first, skb, next) { - if (likely(skb_encrypt(skb, PACKET_CB(first)->keypair, have_simd))) + if (likely(skb_encrypt(skb, PACKET_CB(first)->keypair, simd_context))) skb_reset(skb); else { state = PACKET_STATE_DEAD; @@ -258,9 +258,9 @@ void packet_encrypt_worker(struct work_struct *work) } queue_enqueue_per_peer(&PACKET_PEER(first)->tx_queue, first, state); - have_simd = simd_relax(have_simd); + simd_context = simd_relax(simd_context); } - simd_put(have_simd); + simd_put(simd_context); } static void packet_create_data(struct sk_buff *first) |