[PATCH net-next v22 07/23] ovpn: implement basic TX path (UDP)

2025-03-11 Thread Antonio Quartulli
Packets sent over the ovpn interface are processed and transmitted to the connected peer, if any. Implementation is UDP only. TCP will be added by a later patch. Note: no crypto/encapsulation exists yet. Packets are just captured and sent. Signed-off-by: Antonio Quartulli --- drivers/net

[PATCH net-next v22 03/23] ovpn: add basic interface creation/destruction/management routines

2025-03-11 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Tested-by: Donald Hunter Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/rt_link.yaml | 16 + drivers/net/ovpn/Makefile| 1 + drivers/net/ovpn/io.c| 22 ++ drivers/net/ovpn

[PATCH net-next v22 09/23] ovpn: implement packet processing

2025-03-11 Thread Antonio Quartulli
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 --- drivers/net/Kconfig| 4 + drivers/net/ovpn/Makefile

[PATCH net-next v22 11/23] ovpn: implement TCP transport

2025-03-11 Thread Antonio Quartulli
it, even if IPV6 is not compiled in. Cc: David Ahern Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Simon Horman Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 4 + drivers/net/ovpn/mai

[PATCH net-next v22 12/23] skb: implement skb_send_sock_locked_with_flags()

2025-03-11 Thread Antonio Quartulli
and add a new interface named skb_send_sock_locked_with_flags(). Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Simon Horman Signed-off-by: Antonio Quartulli --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 18 +- 2 files changed, 15 insertions(+), 5 delet

[PATCH net-next v22 13/23] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg

2025-03-11 Thread Antonio Quartulli
Userspace may want to pass the MSG_NOSIGNAL flag to tcp_sendmsg() in order to avoid generating a SIGPIPE. To pass this flag down the TCP stack a new skb sending API accepting a flags argument is introduced. Cc: Eric Dumazet Cc: Paolo Abeni Signed-off-by: Antonio Quartulli --- drivers/net

[PATCH net-next v22 10/23] ovpn: store tunnel and transport statistics

2025-03-11 Thread Antonio Quartulli
Byte/packet counters for in-tunnel and transport streams are now initialized and updated as needed. To be exported via netlink. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 12 +++- drivers/net/ovpn/peer.c | 2 ++ drivers/net

[PATCH net-next v22 23/23] testing/selftests: add test tool and scripts for ovpn module

2025-03-11 Thread Antonio Quartulli
+++ b/tools/testing/selftests/net/ovpn/common.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2020-2025 OpenVPN, Inc. +# +# Author: Antonio Quartulli + +UDP_PEERS_FILE=${UDP_PEERS_FILE:-udp_peers.txt} +TCP_PEERS_FILE=${TCP_PEERS_FILE:-tcp_peers.txt} +OV

[PATCH net-next v22 15/23] ovpn: implement peer lookup logic

2025-03-11 Thread Antonio Quartulli
: Antonio Quartulli --- drivers/net/ovpn/peer.c | 301 ++-- 1 file changed, 291 insertions(+), 10 deletions(-) diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c index bed2e591c000c4efecdcd92db484e590f97f9f7f

[PATCH net-next v22 05/23] ovpn: introduce the ovpn_peer object

2025-03-11 Thread Antonio Quartulli
ovpn_peer, also the ovpn_bind object is introcued as the two are strictly related. An ovpn_bind object wraps a sockaddr representing the local coordinates being used to talk to a specific peer. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile | 2

[PATCH net-next v22 21/23] ovpn: notify userspace when a peer is deleted

2025-03-11 Thread Antonio Quartulli
Whenever a peer is deleted, send a notification to userspace so that it can react accordingly. This is most important when a peer is deleted due to ping timeout, because it all happens in kernelspace and thus userspace has no direct way to learn about it. Signed-off-by: Antonio Quartulli

[PATCH net-next v22 22/23] ovpn: add basic ethtool support

2025-03-11 Thread Antonio Quartulli
Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++ 1 file

[PATCH net-next v22 19/23] ovpn: implement key add/get/del/swap via netlink

2025-03-11 Thread Antonio Quartulli
This change introduces the netlink commands needed to add, get, delete and swap keys for a specific peer. Userspace is expected to use these commands to create, inspect (non sensitive data only), destroy and rotate session keys for a specific peer. Signed-off-by: Antonio Quartulli --- drivers

[PATCH net-next v22 18/23] ovpn: implement peer add/get/dump/delete via netlink

2025-03-11 Thread Antonio Quartulli
This change introduces the netlink command needed to add, delete and retrieve/dump known peers. Userspace is expected to use these commands to handle known peer lifecycles. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/netlink.c | 677

[PATCH net-next v22 20/23] ovpn: kill key and notify userspace in case of IV exhaustion

2025-03-11 Thread Antonio Quartulli
amount of traffic by periodically polling GET_PEER and fetching the VPN/LINK stats. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/crypto.c | 19 ++ drivers/net/ovpn/crypto.h | 2 ++ drivers/net/ovpn/io.c | 13 ++ drivers/net/ovpn/netlink.c | 64

[PATCH net-next v22 02/23] ovpn: add basic netlink support

2025-03-11 Thread Antonio Quartulli
/ovpn/netlink-gen.h Reviewed-by: Donald Hunter Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/ovpn.yaml | 367 ++ MAINTAINERS | 2 + drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/main.c

[PATCH net-next v22 16/23] ovpn: implement keepalive mechanism

2025-03-11 Thread Antonio Quartulli
OpenVPN supports configuring a periodic keepalive packet. message to allow the remote endpoint detect link failures. This change implements the keepalive sending and timer expiring logic. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 74 drivers/net/ovpn

[PATCH net-next v22 04/23] ovpn: keep carrier always on for MP interfaces

2025-03-11 Thread Antonio Quartulli
An ovpn interface configured in MP mode will keep carrier always on and let the user decide when to bring it administratively up and down. This way a MP node (i.e. a server) will keep its interface always up and running, even when no peer is connected. Signed-off-by: Antonio Quartulli

[PATCH net-next v22 17/23] ovpn: add support for updating local or remote UDP endpoint

2025-03-11 Thread Antonio Quartulli
In case of UDP links, the local or remote endpoint used to communicate with a given peer may change without a connection restart. Add support for learning the new address in case of change. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 8 ++ drivers/net/ovpn/peer.c | 213

Re: [PATCH net-next v20 00/25] Introducing OpenVPN Data Channel Offload

2025-02-28 Thread Antonio Quartulli
On 2/27/25 5:21 PM, Jakub Kicinski wrote: On Thu, 27 Feb 2025 02:21:25 +0100 Antonio Quartulli wrote: After some time of struggle trying to fix all hidden bugs that Sabrina has found...here is v20! Please note that some patches were already reviewed/tested by a few people. These patches have

[PATCH net-next v22 14/23] ovpn: implement multi-peer support

2025-03-11 Thread Antonio Quartulli
With this change an ovpn instance will be able to stay connected to multiple remote endpoints. This functionality is strictly required when running ovpn on an OpenVPN server. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 64 +-- drivers/net/ovpn/ovpnpriv.h

[PATCH net-next v23 14/23] ovpn: implement multi-peer support

2025-03-12 Thread Antonio Quartulli
With this change an ovpn instance will be able to stay connected to multiple remote endpoints. This functionality is strictly required when running ovpn on an OpenVPN server. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 64 +-- drivers/net/ovpn/ovpnpriv.h

Re: [PATCH v21 18/24] ovpn: add support for peer floating

2025-03-05 Thread Antonio Quartulli
On 05/03/2025 12:20, Sabrina Dubroca wrote: 2025-03-05, 00:19:32 +0100, Antonio Quartulli wrote: On 04/03/2025 19:37, Sabrina Dubroca wrote: 2025-03-04, 01:33:48 +0100, Antonio Quartulli wrote: A peer connected via UDP may change its IP address without reconnecting (float). Should that

Re: [PATCH v21 20/24] ovpn: implement key add/get/del/swap via netlink

2025-03-05 Thread Antonio Quartulli
On 05/03/2025 11:11, Sabrina Dubroca wrote: 2025-03-05, 02:00:21 +0100, Antonio Quartulli wrote: On 05/03/2025 00:09, Sabrina Dubroca wrote: 2025-03-04, 13:11:28 +0100, Antonio Quartulli wrote: On 04/03/2025 13:00, Sabrina Dubroca wrote: 2025-03-04, 01:33:50 +0100, Antonio Quartulli wrote

Re: [PATCH v21 19/24] ovpn: implement peer add/get/dump/delete via netlink

2025-03-04 Thread Antonio Quartulli
On 04/03/2025 15:35, Sabrina Dubroca wrote: 2025-03-04, 01:33:49 +0100, Antonio Quartulli wrote: @@ -1317,11 +1336,16 @@ void ovpn_peer_keepalive_work(struct work_struct *work) /* prevent rearming if the interface is being destroyed */ if (next_run > 0 && ovpn-

Re: [PATCH v21 18/24] ovpn: add support for peer floating

2025-03-04 Thread Antonio Quartulli
On 05/03/2025 00:19, Antonio Quartulli wrote: On 04/03/2025 19:37, Sabrina Dubroca wrote: 2025-03-04, 01:33:48 +0100, Antonio Quartulli wrote: A peer connected via UDP may change its IP address without reconnecting (float). Should that trigger a reset of the peer->dst_cache? And same w

[PATCH net-next v23 03/23] ovpn: add basic interface creation/destruction/management routines

2025-03-12 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Tested-by: Donald Hunter Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/rt_link.yaml | 16 + drivers/net/ovpn/Makefile| 1 + drivers/net/ovpn/io.c| 22 ++ drivers/net/ovpn

[PATCH net-next v23 02/23] ovpn: add basic netlink support

2025-03-12 Thread Antonio Quartulli
/ovpn/netlink-gen.h Reviewed-by: Donald Hunter Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/ovpn.yaml | 367 ++ MAINTAINERS | 2 + drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/main.c

[PATCH net-next v23 01/23] net: introduce OpenVPN Data Channel Offload (ovpn)

2025-03-12 Thread Antonio Quartulli
ff-by: Antonio Quartulli --- MAINTAINERS | 8 drivers/net/Kconfig | 8 drivers/net/Makefile | 1 + drivers/net/ovpn/Makefile | 10 + drivers/net/ovpn/main.c | 112 ++ 5 files changed, 139 insertions(+)

[PATCH net-next v23 00/23] Introducing OpenVPN Data Channel Offload

2025-03-12 Thread Antonio Quartulli
avoid useless casts Please note that some patches were already reviewed/tested by a few people. These patches have retained the tags as they have hardly been touched. The latest code can also be found at: https://github.com/OpenVPN/ovpn-net-next Thanks a lot! Best Regards, Antonio Quartulli OpenV

[PATCH net-next v23 06/23] ovpn: introduce the ovpn_socket object

2025-03-12 Thread Antonio Quartulli
a later patch. Cc: willemdebruijn.ker...@gmail.com Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/main.c | 2 +- drivers/net/ovpn/peer.c | 28 +-- drivers/net/ovpn/peer.h | 6 +- drivers/net/ovpn/socket.c | 208

[PATCH net-next v23 04/23] ovpn: keep carrier always on for MP interfaces

2025-03-12 Thread Antonio Quartulli
An ovpn interface configured in MP mode will keep carrier always on and let the user decide when to bring it administratively up and down. This way a MP node (i.e. a server) will keep its interface always up and running, even when no peer is connected. Signed-off-by: Antonio Quartulli

[PATCH net-next v23 08/23] ovpn: implement basic RX path (UDP)

2025-03-12 Thread Antonio Quartulli
Packets received over the socket are forwarded to the user device. Implementation is UDP only. TCP will be added by a later patch. Note: no decryption/decapsulation exists yet, packets are forwarded as they arrive without much processing. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn

[PATCH net-next v23 09/23] ovpn: implement packet processing

2025-03-12 Thread Antonio Quartulli
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 --- drivers/net/Kconfig| 4 + drivers/net/ovpn/Makefile

[PATCH net-next v23 05/23] ovpn: introduce the ovpn_peer object

2025-03-12 Thread Antonio Quartulli
ovpn_peer, also the ovpn_bind object is introcued as the two are strictly related. An ovpn_bind object wraps a sockaddr representing the local coordinates being used to talk to a specific peer. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile | 2

[PATCH net-next v23 12/23] skb: implement skb_send_sock_locked_with_flags()

2025-03-12 Thread Antonio Quartulli
and add a new interface named skb_send_sock_locked_with_flags(). Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Simon Horman Signed-off-by: Antonio Quartulli --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 18 +- 2 files changed, 15 insertions(+), 5 delet

[PATCH net-next v23 13/23] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg

2025-03-12 Thread Antonio Quartulli
Userspace may want to pass the MSG_NOSIGNAL flag to tcp_sendmsg() in order to avoid generating a SIGPIPE. To pass this flag down the TCP stack a new skb sending API accepting a flags argument is introduced. Cc: Eric Dumazet Cc: Paolo Abeni Signed-off-by: Antonio Quartulli --- drivers/net

[PATCH net-next v23 18/23] ovpn: implement peer add/get/dump/delete via netlink

2025-03-12 Thread Antonio Quartulli
This change introduces the netlink command needed to add, delete and retrieve/dump known peers. Userspace is expected to use these commands to handle known peer lifecycles. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/netlink.c | 677

[PATCH net-next v23 17/23] ovpn: add support for updating local or remote UDP endpoint

2025-03-12 Thread Antonio Quartulli
In case of UDP links, the local or remote endpoint used to communicate with a given peer may change without a connection restart. Add support for learning the new address in case of change. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 8 ++ drivers/net/ovpn/peer.c | 213

[PATCH net-next v23 21/23] ovpn: notify userspace when a peer is deleted

2025-03-12 Thread Antonio Quartulli
Whenever a peer is deleted, send a notification to userspace so that it can react accordingly. This is most important when a peer is deleted due to ping timeout, because it all happens in kernelspace and thus userspace has no direct way to learn about it. Signed-off-by: Antonio Quartulli

[PATCH net-next v23 07/23] ovpn: implement basic TX path (UDP)

2025-03-12 Thread Antonio Quartulli
Packets sent over the ovpn interface are processed and transmitted to the connected peer, if any. Implementation is UDP only. TCP will be added by a later patch. Note: no crypto/encapsulation exists yet. Packets are just captured and sent. Signed-off-by: Antonio Quartulli --- drivers/net

[PATCH net-next v23 22/23] ovpn: add basic ethtool support

2025-03-12 Thread Antonio Quartulli
Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++ 1 file

[PATCH net-next v23 23/23] testing/selftests: add test tool and scripts for ovpn module

2025-03-12 Thread Antonio Quartulli
+++ b/tools/testing/selftests/net/ovpn/common.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2020-2025 OpenVPN, Inc. +# +# Author: Antonio Quartulli + +UDP_PEERS_FILE=${UDP_PEERS_FILE:-udp_peers.txt} +TCP_PEERS_FILE=${TCP_PEERS_FILE:-tcp_peers.txt} +OV

[PATCH net-next v23 10/23] ovpn: store tunnel and transport statistics

2025-03-12 Thread Antonio Quartulli
Byte/packet counters for in-tunnel and transport streams are now initialized and updated as needed. To be exported via netlink. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 12 +++- drivers/net/ovpn/peer.c | 2 ++ drivers/net

[PATCH net-next v23 20/23] ovpn: kill key and notify userspace in case of IV exhaustion

2025-03-12 Thread Antonio Quartulli
amount of traffic by periodically polling GET_PEER and fetching the VPN/LINK stats. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/crypto.c | 19 ++ drivers/net/ovpn/crypto.h | 2 ++ drivers/net/ovpn/io.c | 13 ++ drivers/net/ovpn/netlink.c | 64

[PATCH net-next v23 16/23] ovpn: implement keepalive mechanism

2025-03-12 Thread Antonio Quartulli
OpenVPN supports configuring a periodic keepalive packet. message to allow the remote endpoint detect link failures. This change implements the keepalive sending and timer expiring logic. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 74 drivers/net/ovpn

[PATCH net-next v23 19/23] ovpn: implement key add/get/del/swap via netlink

2025-03-12 Thread Antonio Quartulli
This change introduces the netlink commands needed to add, get, delete and swap keys for a specific peer. Userspace is expected to use these commands to create, inspect (non sensitive data only), destroy and rotate session keys for a specific peer. Signed-off-by: Antonio Quartulli --- drivers

[PATCH net-next v23 11/23] ovpn: implement TCP transport

2025-03-12 Thread Antonio Quartulli
it, even if IPV6 is not compiled in. Cc: David Ahern Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Simon Horman Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 4 + drivers/net/ovpn/mai

Re: [PATCH net-next v19 00/26] Introducing OpenVPN Data Channel Offload

2025-02-13 Thread Antonio Quartulli
On 13/02/2025 16:46, Sabrina Dubroca wrote: 2025-02-13, 12:46:34 +0100, Antonio Quartulli wrote: On 13/02/2025 00:34, Sabrina Dubroca wrote: Hello, 2025-02-11, 01:39:53 +0100, Antonio Quartulli wrote: All minor and major reported problems have been finally addressed. Big thanks to Sabrina

Re: [PATCH net-next v19 00/26] Introducing OpenVPN Data Channel Offload

2025-02-13 Thread Antonio Quartulli
Hi Sean, On 13/02/2025 15:26, Sean Anderson wrote: Hi Antonio, On 2/10/25 19:39, Antonio Quartulli wrote: NOTE: TCP tests are still showing the following warning while running iperf. I have analysed the report several times, but it definitely looks like a false positive to me, so nothing to

[PATCH net-next v20 00/25] Introducing OpenVPN Data Channel Offload

2025-02-26 Thread Antonio Quartulli
e Reviewed-by Shuah Khan tag on that specific patch) The latest code can also be found at: https://github.com/OpenVPN/ovpn-net-next Thanks a lot! Best Regards, Antonio Quartulli OpenVPN Inc. --- Antonio Quartulli (25): mailmap: remove unwanted entry for Antonio Quartulli net: intr

[PATCH net-next v20 01/25] mailmap: remove unwanted entry for Antonio Quartulli

2025-02-26 Thread Antonio Quartulli
anto...@openvpn.net is still used for sending patches under the OpenVPN Inc. umbrella, therefore this address should not be re-mapped. Cc: Andrew Morton Signed-off-by: Antonio Quartulli --- .mailmap | 1 - 1 file changed, 1 deletion(-) diff --git a/.mailmap b/.mailmap index

[PATCH net-next v20 02/25] net: introduce OpenVPN Data Channel Offload (ovpn)

2025-02-26 Thread Antonio Quartulli
ff-by: Antonio Quartulli --- MAINTAINERS | 8 drivers/net/Kconfig | 8 drivers/net/Makefile | 1 + drivers/net/ovpn/Makefile | 10 + drivers/net/ovpn/main.c | 112 ++ 5 files changed, 139 insertions(+)

[PATCH net-next v20 04/25] ovpn: add basic interface creation/destruction/management routines

2025-02-26 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Tested-by: Donald Hunter Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/rt_link.yaml | 16 + drivers/net/ovpn/Makefile| 1 + drivers/net/ovpn/io.c| 22 ++ drivers/net/ovpn

[PATCH net-next v20 06/25] ovpn: introduce the ovpn_peer object

2025-02-26 Thread Antonio Quartulli
ovpn_peer, also the ovpn_bind object is introcued as the two are strictly related. An ovpn_bind object wraps a sockaddr representing the local coordinates being used to talk to a specific peer. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile | 2

[PATCH net-next v20 08/25] ovpn: implement basic TX path (UDP)

2025-02-26 Thread Antonio Quartulli
Packets sent over the ovpn interface are processed and transmitted to the connected peer, if any. Implementation is UDP only. TCP will be added by a later patch. Note: no crypto/encapsulation exists yet. Packets are just captured and sent. Signed-off-by: Antonio Quartulli --- drivers/net

[PATCH net-next v20 05/25] ovpn: keep carrier always on for MP interfaces

2025-02-26 Thread Antonio Quartulli
An ovpn interface configured in MP mode will keep carrier always on and let the user decide when to bring it administratively up and down. This way a MP node (i.e. a server) will keep its interface always up and running, even when no peer is connected. Signed-off-by: Antonio Quartulli

[PATCH net-next v20 09/25] ovpn: implement basic RX path (UDP)

2025-02-26 Thread Antonio Quartulli
Packets received over the socket are forwarded to the user device. Implementation is UDP only. TCP will be added by a later patch. Note: no decryption/decapsulation exists yet, packets are forwarded as they arrive without much processing. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn

[PATCH net-next v20 07/25] ovpn: introduce the ovpn_socket object

2025-02-26 Thread Antonio Quartulli
a later patch. Cc: willemdebruijn.ker...@gmail.com Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/main.c | 2 +- drivers/net/ovpn/peer.c | 28 +-- drivers/net/ovpn/peer.h | 6 +- drivers/net/ovpn/socket.c | 208

[PATCH net-next v20 13/25] skb: implement skb_send_sock_locked_with_flags()

2025-02-26 Thread Antonio Quartulli
and add a new interface named skb_send_sock_locked_with_flags(). Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Simon Horman Signed-off-by: Antonio Quartulli --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 18 +- 2 files changed, 15 insertions(+), 5 delet

[PATCH net-next v20 10/25] ovpn: implement packet processing

2025-02-26 Thread Antonio Quartulli
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 --- drivers/net/Kconfig| 4 + drivers/net/ovpn/Makefile

[PATCH net-next v20 11/25] ovpn: store tunnel and transport statistics

2025-02-26 Thread Antonio Quartulli
Byte/packet counters for in-tunnel and transport streams are now initialized and updated as needed. To be exported via netlink. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 12 +++- drivers/net/ovpn/peer.c | 2 ++ drivers/net

[PATCH net-next v20 12/25] ovpn: implement TCP transport

2025-02-26 Thread Antonio Quartulli
it, even if IPV6 is not compiled in. Cc: David Ahern Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Simon Horman Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 4 + drivers/net/ovpn/mai

[PATCH net-next v20 16/25] ovpn: implement peer lookup logic

2025-02-26 Thread Antonio Quartulli
: Antonio Quartulli --- drivers/net/ovpn/peer.c | 301 ++-- 1 file changed, 291 insertions(+), 10 deletions(-) diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c index b21ef6f10a7138e9f10c01b809df2cb0adf0abad

[PATCH net-next v20 17/25] ovpn: implement keepalive mechanism

2025-02-26 Thread Antonio Quartulli
OpenVPN supports configuring a periodic keepalive packet. message to allow the remote endpoint detect link failures. This change implements the keepalive sending and timer expiring logic. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 74 drivers/net/ovpn

[PATCH net-next v20 18/25] ovpn: add support for updating local UDP endpoint

2025-02-26 Thread Antonio Quartulli
In case of UDP links, the local endpoint used to communicate with a given peer may change without a connection restart. Add support for learning the new address in case of change. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/peer.c | 45

[PATCH net-next v20 14/25] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg

2025-02-26 Thread Antonio Quartulli
Userspace may want to pass the MSG_NOSIGNAL flag to tcp_sendmsg() in order to avoid generating a SIGPIPE. To pass this flag down the TCP stack a new skb sending API accepting a flags argument is introduced. Cc: Eric Dumazet Cc: Paolo Abeni Signed-off-by: Antonio Quartulli --- drivers/net

[PATCH net-next v20 15/25] ovpn: implement multi-peer support

2025-02-26 Thread Antonio Quartulli
With this change an ovpn instance will be able to stay connected to multiple remote endpoints. This functionality is strictly required when running ovpn on an OpenVPN server. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 68 - drivers/net/ovpn/ovpnpriv.h

[PATCH net-next v20 19/25] ovpn: add support for peer floating

2025-02-26 Thread Antonio Quartulli
A peer connected via UDP may change its IP address without reconnecting (float). Add support for detecting and updating the new peer IP/port in case of floating. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 8 ++ drivers/net/ovpn/peer.c | 243

[PATCH net-next v20 22/25] ovpn: kill key and notify userspace in case of IV exhaustion

2025-02-26 Thread Antonio Quartulli
amount of traffic by periodically polling GET_PEER and fetching the VPN/LINK stats. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/crypto.c | 19 ++ drivers/net/ovpn/crypto.h | 2 ++ drivers/net/ovpn/io.c | 13 ++ drivers/net/ovpn/netlink.c | 64

[PATCH net-next v20 23/25] ovpn: notify userspace when a peer is deleted

2025-02-26 Thread Antonio Quartulli
Whenever a peer is deleted, send a notification to userspace so that it can react accordingly. This is most important when a peer is deleted due to ping timeout, because it all happens in kernelspace and thus userspace has no direct way to learn about it. Signed-off-by: Antonio Quartulli

[PATCH net-next v20 25/25] testing/selftests: add test tool and scripts for ovpn module

2025-02-26 Thread Antonio Quartulli
v/null +++ b/tools/testing/selftests/net/ovpn/common.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2020-2025 OpenVPN, Inc. +# +# Author: Antonio Quartulli + +UDP_PEERS_FILE=${UDP_PEERS_FILE:-udp_peers.txt} +TCP_PEERS_FILE=${TCP_PEERS_FILE:-tcp_peers.txt} +OV

[PATCH net-next v20 03/25] ovpn: add basic netlink support

2025-02-26 Thread Antonio Quartulli
/ovpn/netlink-gen.h Reviewed-by: Donald Hunter Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/ovpn.yaml | 371 ++ MAINTAINERS | 2 + drivers/net/ovpn/Makefile | 2 + drivers/net/ovpn/main.c

[PATCH net-next v20 21/25] ovpn: implement key add/get/del/swap via netlink

2025-02-26 Thread Antonio Quartulli
This change introduces the netlink commands needed to add, get, delete and swap keys for a specific peer. Userspace is expected to use these commands to create, inspect (non sensitive data only), destroy and rotate session keys for a specific peer. Signed-off-by: Antonio Quartulli --- drivers

[PATCH net-next v20 24/25] ovpn: add basic ethtool support

2025-02-26 Thread Antonio Quartulli
Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++ 1 file

[PATCH net-next v20 20/25] ovpn: implement peer add/get/dump/delete via netlink

2025-02-26 Thread Antonio Quartulli
This change introduces the netlink command needed to add, delete and retrieve/dump known peers. Userspace is expected to use these commands to handle known peer lifecycles. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/netlink.c | 677

Re: [PATCH net-next v24 00/23] Introducing OpenVPN Data Channel Offload

2025-03-28 Thread Antonio Quartulli
Hi Sabrina, do you plan to drop more comments at the patchset at this point? I have gone through all requested changes and I'll just get the patches ready for submission once net-next is open again. Thanks a lot! Cheers, On 18/03/2025 02:40, Antonio Quartulli wrote: Notable changes

Re: [PATCH net-next v24 06/23] ovpn: introduce the ovpn_socket object

2025-04-02 Thread Antonio Quartulli
On 01/04/2025 15:05, Sabrina Dubroca wrote: 2025-03-18, 02:40:41 +0100, Antonio Quartulli wrote: +void ovpn_socket_release(struct ovpn_peer *peer) +{ + struct ovpn_socket *sock; + + might_sleep(); + + /* release may be invoked after socket was detached */ + rcu_read_lock

Re: [PATCH net-next v24 11/23] ovpn: implement TCP transport

2025-04-02 Thread Antonio Quartulli
On 01/04/2025 12:02, Sabrina Dubroca wrote: 2025-03-18, 02:40:46 +0100, Antonio Quartulli wrote: +static void ovpn_tcp_rcv(struct strparser *strp, struct sk_buff *skb) +{ [...] + /* we need the first byte of data to be accessible nit: and "first byte" here too (that com

Re: [PATCH net-next v24 09/23] ovpn: implement packet processing

2025-04-02 Thread Antonio Quartulli
On 01/04/2025 11:59, Sabrina Dubroca wrote: 2025-03-18, 02:40:44 +0100, Antonio Quartulli wrote: +/* this swap is not atomic, but there will be a very short time frame where the + * old_secondary key won't be available. This should not be a big deal as most + * likely both peers are al

Re: [PATCH net-next v24 16/23] ovpn: implement keepalive mechanism

2025-04-02 Thread Antonio Quartulli
On 01/04/2025 14:51, Sabrina Dubroca wrote: 2025-03-18, 02:40:51 +0100, Antonio Quartulli wrote: @@ -124,6 +154,13 @@ void ovpn_decrypt_post(void *data, int ret) goto drop; } + if (ovpn_is_keepalive(skb)) { + net_dbg_ratelimited

Re: [PATCH net-next v24 07/23] ovpn: implement basic TX path (UDP)

2025-04-04 Thread Antonio Quartulli
On 01/04/2025 15:49, Sabrina Dubroca wrote: 2025-03-18, 02:40:42 +0100, Antonio Quartulli wrote: +static int ovpn_udp_output(struct ovpn_peer *peer, struct dst_cache *cache, + struct sock *sk, struct sk_buff *skb) +{ + struct ovpn_bind *bind; + int ret

Re: [PATCH net-next v24 08/23] ovpn: implement basic RX path (UDP)

2025-04-04 Thread Antonio Quartulli
On 01/04/2025 11:47, Sabrina Dubroca wrote: 2025-03-18, 02:40:43 +0100, Antonio Quartulli wrote: diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 024458ef163c9e24dfb37aea2690b2030f6a0fbc..b30175e34230d3dbf5d253838df894f0625c705c 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -1933,6

<    2   3   4   5   6   7