commit fdee14093d073aeefa410a3088eb80074c2876b6
Author: Leigh Scott <leigh123linux(a)googlemail.com>
Date: Wed Sep 4 10:14:50 2019 +0100
Drop support for < 4.4 kernel
wireguard-kmod.spec | 3 ++-
wireguard-rhel.patch | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/wireguard-kmod.spec b/wireguard-kmod.spec
index af69113..79e7fa9 100644
--- a/wireguard-kmod.spec
+++ b/wireguard-kmod.spec
@@ -11,6 +11,7 @@ License: GPLv2
URL:
https://www.wireguard.com/
Source0:
https://git.zx2c4.com/WireGuard/snapshot/WireGuard-%{version}.tar.xz
+Patch0: wireguard-rhel.patch
BuildRequires: kmodtool
BuildRequires: elfutils-libelf-devel
@@ -37,7 +38,7 @@ This package contains the kmod module for WireGuard.
# print kmodtool output for debugging purposes:
kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name}
%{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"}
2>/dev/null
-%autosetup -c -T -a 0
+%autosetup -c -T -a 0 -p 1
for kernel_version in %{?kernel_versions} ; do
cp -a WireGuard-%{version} _kmod_build_${kernel_version%%___*}
diff --git a/wireguard-rhel.patch b/wireguard-rhel.patch
new file mode 100644
index 0000000..b351f8e
--- /dev/null
+++ b/wireguard-rhel.patch
@@ -0,0 +1,22 @@
+--- a/WireGuard-0.0.20190702/src/compat/compat.h
++++ b/WireGuard-0.0.20190702/src/compat/compat.h
+@@ -79,18 +79,6 @@
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) && !defined(ISRHEL7)
+ #define ipv6_dst_lookup(a, b, c, d) ipv6_dst_lookup(b, c, d)
+-#endif
+-
+-#if (LINUX_VERSION_CODE == KERNEL_VERSION(4, 4, 0) || \
+- (LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 5) && LINUX_VERSION_CODE >=
KERNEL_VERSION(4, 2, 0)) || \
+- (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 17) && LINUX_VERSION_CODE >
KERNEL_VERSION(3, 19, 0)) || \
+- (LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 27) && LINUX_VERSION_CODE
>= KERNEL_VERSION(3, 17, 0)) || \
+- (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 8) && LINUX_VERSION_CODE
>= KERNEL_VERSION(3, 15, 0)) || \
+- (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 40) && LINUX_VERSION_CODE
>= KERNEL_VERSION(3, 13, 0)) || \
+- (LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 54))) &&
!defined(ISUBUNTU1404)
+-#include <linux/if.h>
+-#include <net/ip_tunnels.h>
+-#define IP6_ECN_set_ce(a, b) IP6_ECN_set_ce(b)
+ #endif
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && IS_ENABLED(CONFIG_IPV6)
&& !defined(ISRHEL7)
+