summaryrefslogtreecommitdiff
path: root/net-vpn/ovpn-dco/files/0001-ovpn-dco-include-new-GSO-header-file.patch
blob: 50e748cb5f0d61fc05f7effb627f92bc87398f45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
From dba96d203f960356b477291d6a58d30fc096fbe4 Mon Sep 17 00:00:00 2001
From: Antonio Quartulli <antonio@openvpn.net>
Date: Wed, 16 Aug 2023 22:15:01 +0200
Subject: [PATCH] ovpn-dco: include new GSO header file

GSO code has ben moved to its own files, therefore a new header
needs to be included accordingly.

This patch also provides some compat files so that ovpn-dco can
continue to compile also on older kernels.

Fixes: https://github.com/OpenVPN/ovpn-dco/issues/42
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
---
 Makefile                    |  4 ++--
 compat-include/net/gso.h    | 20 ++++++++++++++++++++
 drivers/net/ovpn-dco/ovpn.c |  1 +
 3 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 compat-include/net/gso.h

diff --git a/Makefile b/Makefile
index a36a4d2..fe535e2 100644
--- a/Makefile
+++ b/Makefile
@@ -34,8 +34,8 @@ ELFLAG := $(EL8FLAG) $(EL9FLAG)
 NOSTDINC_FLAGS += \
 	-I$(PWD)/include/ \
 	$(CFLAGS) $(ELFLAG) \
-	-include $(PWD)/linux-compat.h
-#	-I$(PWD)/compat-include/
+	-include $(PWD)/linux-compat.h \
+	-I$(PWD)/compat-include/
 
 ifneq ($(REVISION),)
 NOSTDINC_FLAGS += -DOVPN_DCO_VERSION=\"$(REVISION)\"
diff --git a/compat-include/net/gso.h b/compat-include/net/gso.h
new file mode 100644
index 0000000..2e41c8b
--- /dev/null
+++ b/compat-include/net/gso.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* OpenVPN data channel accelerator
+ *
+ *  Copyright (C) 2023 OpenVPN, Inc.
+ *
+ *  Author:	Antonio Quartulli <antonio@openvpn.net>
+ */
+
+#ifndef _NET_OVPN_COMPAT_NET_GSO_H
+#define _NET_OVPN_COMPAT_NET_GSO_H
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 10)
+#include_next <net/gso.h>
+#else
+#include <linux/netdevice.h>
+#endif
+
+#endif /* _NET_OVPN_COMPAT_NET_GSO_H */
diff --git a/drivers/net/ovpn-dco/ovpn.c b/drivers/net/ovpn-dco/ovpn.c
index 772a34b..82e9f94 100644
--- a/drivers/net/ovpn-dco/ovpn.c
+++ b/drivers/net/ovpn-dco/ovpn.c
@@ -22,6 +22,7 @@
 #include "udp.h"
 
 #include <linux/workqueue.h>
+#include <net/gso.h>
 #include <uapi/linux/if_ether.h>
 
 static const unsigned char ovpn_keepalive_message[] = {
-- 
2.41.0