Thread (71 messages) 71 messages, 4 authors, 2024-07-19

Re: [PATCH net-next v5 10/25] ovpn: implement basic TX path (UDP)

From: Sabrina Dubroca <sd@queasysnail.net>
Date: 2024-07-18 10:07:51

2024-06-27, 15:08:28 +0200, Antonio Quartulli wrote:
+static bool ovpn_encrypt_one(struct ovpn_peer *peer, struct sk_buff *skb)
+{
+	ovpn_skb_cb(skb)->peer = peer;
+
+	/* take a reference to the peer because the crypto code may run async.
+	 * ovpn_encrypt_post() will release it upon completion
+	 */
+	DEBUG_NET_WARN_ON_ONCE(!ovpn_peer_hold(peer));
Shouldn't we abort if this fails? This should not really happen, but
if it did, we would proceed (possibly with async crypto) without a ref
on the peer.
+	ovpn_encrypt_post(skb, 0);
+	return true;
+}
+
[...]
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ovpn/io.h b/drivers/net/ovpn/io.h
index aa259be66441..95568671d5ae 100644
--- a/drivers/net/ovpn/io.h
+++ b/drivers/net/ovpn/io.h
@@ -12,4 +12,6 @@
 
 netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev);
 
+void ovpn_encrypt_work(struct work_struct *work);
leftover from the old implementation I think?

-- 
Sabrina
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help