diff options
author | 2025-04-15 13:17:25 +0200 | |
---|---|---|
committer | 2025-04-17 12:30:02 +0200 | |
commit | ab66abbc769b894324864a68e9dcaf3eb2d4bfdb (patch) | |
tree | 6ef3687ab7139aa86c7c2c640ad5d05f4e813ca8 /drivers/net/ovpn/main.c | |
parent | ovpn: implement basic TX path (UDP) (diff) | |
download | wireguard-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.c | 18 |
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, }; |