aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ovpn/main.c
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@openvpn.net>2025-04-15 13:17:25 +0200
committerPaolo Abeni <pabeni@redhat.com>2025-04-17 12:30:02 +0200
commitab66abbc769b894324864a68e9dcaf3eb2d4bfdb (patch)
tree6ef3687ab7139aa86c7c2c640ad5d05f4e813ca8 /drivers/net/ovpn/main.c
parentovpn: implement basic TX path (UDP) (diff)
downloadwireguard-linux-ab66abbc769b894324864a68e9dcaf3eb2d4bfdb.tar.xz
wireguard-linux-ab66abbc769b894324864a68e9dcaf3eb2d4bfdb.zip
ovpn: implement basic RX path (UDP)
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 <antonio@openvpn.net> Link: https://patch.msgid.link/20250415-b4-ovpn-v26-8-577f6097b964@openvpn.net Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ovpn/main.c')
-rw-r--r--drivers/net/ovpn/main.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ovpn/main.c b/drivers/net/ovpn/main.c
index e9a6dc100d46..b356c2235d46 100644
--- a/drivers/net/ovpn/main.c
+++ b/drivers/net/ovpn/main.c
@@ -11,6 +11,7 @@
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
+#include <net/gro_cells.h>
#include <net/ip.h>
#include <net/rtnetlink.h>
#include <uapi/linux/if_arp.h>
@@ -21,8 +22,25 @@
#include "io.h"
#include "peer.h"
#include "proto.h"
+#include "udp.h"
+
+static int ovpn_net_init(struct net_device *dev)
+{
+ struct ovpn_priv *ovpn = netdev_priv(dev);
+
+ return gro_cells_init(&ovpn->gro_cells, dev);
+}
+
+static void ovpn_net_uninit(struct net_device *dev)
+{
+ struct ovpn_priv *ovpn = netdev_priv(dev);
+
+ gro_cells_destroy(&ovpn->gro_cells);
+}
static const struct net_device_ops ovpn_netdev_ops = {
+ .ndo_init = ovpn_net_init,
+ .ndo_uninit = ovpn_net_uninit,
.ndo_start_xmit = ovpn_net_xmit,
};