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

Re: [PATCH net-next v5 05/25] ovpn: add basic interface creation/destruction/management routines

From: Antonio Quartulli <antonio@openvpn.net>
Date: 2024-07-01 08:46:56

Hi,

On 29/06/2024 00:11, Sabrina Dubroca wrote:
2024-06-27, 15:08:23 +0200, Antonio Quartulli wrote:
quoted
+static void ovpn_setup(struct net_device *dev)
+{
+	/* compute the overhead considering AEAD encryption */
+	const int overhead = sizeof(u32) + NONCE_WIRE_SIZE + 16 +
Is that 16 equal to OVPN_MAX_PADDING? Or some other constant that
would help figure out the details of that overhead?
That's the size of the auth tag.

Sadly the explanation of the OpenVPN header (with AEAD encryption) is 
only described in a comment inside ovpn_aead_encrypt().

Here the comment is much "slimmer"..

In crypto_aead.c it is defined as AUTH_TAG_SIZE.
Maybe I could export that define and reuse it here.

Same goes for the "4" in ovpn_aead_encap_overhead(), which is actually 
NONCE_WIRE_SIZE.
quoted
+			     sizeof(struct udphdr) +
+			     max(sizeof(struct ipv6hdr), sizeof(struct iphdr));
+
+	netdev_features_t feat = NETIF_F_SG | NETIF_F_LLTX |
[...]
quoted
+	dev->features |= feat;
+	dev->hw_features |= feat;
I'm not sure we want NETIF_F_LLTX to be part of hw_features, I think
it's more of a property of the device than something we want to let
users toggle. AFAICT no other virtual driver does that.
I agree. It should *not* be part of hw_features.
I'll remove it from 'feat' and assign it only to '->features'.


Regards,


-- 
Antonio Quartulli
OpenVPN Inc.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help