Thread (58 messages) 58 messages, 4 authors, 2024-09-23

Re: [PATCH net-next v6 12/25] ovpn: implement packet processing

From: Simon Horman <horms@kernel.org>
Date: 2024-09-06 19:29:29

On Tue, Aug 27, 2024 at 02:07:52PM +0200, Antonio Quartulli wrote:
This change implements encryption/decryption and
encapsulation/decapsulation of OpenVPN packets.

Support for generic crypto state is added along with
a wrapper for the AEAD crypto kernel API.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
...
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c
...
quoted hunk ↗ jump to hunk
@@ -54,39 +56,122 @@ static void ovpn_netdev_write(struct ovpn_peer *peer, struct sk_buff *skb)
 		dev_sw_netstats_rx_add(peer->ovpn->dev, skb->len);
 }
 
-static void ovpn_decrypt_post(struct sk_buff *skb, int ret)
+void ovpn_decrypt_post(struct sk_buff *skb, int ret)
 {
-	struct ovpn_peer *peer = ovpn_skb_cb(skb)->peer;
+	struct ovpn_crypto_key_slot *ks = ovpn_skb_cb(skb)->ctx->ks;
+	struct ovpn_peer *peer = ovpn_skb_cb(skb)->ctx->peer;
+	__be16 proto;
+	__be32 *pid;
 
-	if (unlikely(ret < 0))
+	/* crypto is happening asyncronously. this function will be called
nit: asynchronously

     Flagged by checkpatch.pl --codespell
+	 * again later by the crypto callback with a proper return code
+	 */
+	if (unlikely(ret == -EINPROGRESS))
+		return;
...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help