All of lore.kernel.org
 help / color / mirror / Atom feed
* making wireguard work on RHEL7/etc.
@ 2017-06-24 15:18 wireguard
  2017-06-26  8:07 ` Aaron Muir Hamilton
  0 siblings, 1 reply; 25+ messages in thread
From: wireguard @ 2017-06-24 15:18 UTC (permalink / raw)
  To: wireguard

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

hello,

the two diffs attached (hopefully not eaten by mailman) made wireguard
work for me on Scientific Linux 7.3 and CentOS Linux 7.3.1611

hopefully they are useful for other people

they were patched against the source installed by
wireguard-dkms-0.0.20170613-1.el7.centos.noarch in /usr/src/wireguard-*

also available here:

https://pastebin.com/uWGWuF8f
https://pastebin.com/P3VqR1H6

[-- Attachment #2: compat-rhel7-patch.diff --]
[-- Type: text/plain, Size: 2341 bytes --]

--- compat/compat.h.orig	2017-06-13 16:33:26.000000000 +0100
+++ compat/compat.h	2017-06-24 15:28:38.866637683 +0100
@@ -7,6 +7,9 @@
 #include <linux/version.h>
 #include <linux/types.h>
 
+#undef  LINUX_VERSION_CODE
+#define LINUX_VERSION_CODE KERNEL_VERSION(3, 18, 0)
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
 #error "WireGuard requires Linux >= 3.10"
 #endif
@@ -29,9 +32,9 @@
 #define headers_end data
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
-#include "udp_tunnel/udp_tunnel_partial_compat.h"
-#endif
+//#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
+//#include "udp_tunnel/udp_tunnel_partial_compat.h"
+//#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) && !defined(DEBUG) && defined(net_dbg_ratelimited)
 #undef net_dbg_ratelimited
@@ -43,14 +46,14 @@
 #endif
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 19, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 6)) || \
-    (LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 12) && 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)
-#define dev_recursion_level() 0
+   (LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 12) && 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)
+//#define dev_recursion_level() 0
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
-#define ipv6_dst_lookup(a, b, c, d) ipv6_dst_lookup(b, c, d)
+//#define ipv6_dst_lookup(a, b, c, d) ipv6_dst_lookup(b, c, d)
 #endif
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 5) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)) || \
@@ -149,7 +152,7 @@
 })
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
+//#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
 #include "checksum/checksum_partial_compat.h"
 static inline void *our_pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
 {
@@ -160,7 +163,7 @@
 	return skb_put(tail, len);
 }
 #define pskb_put our_pskb_put
-#endif
+//#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
 #include <net/xfrm.h>

[-- Attachment #3: siphash-rhel7-patch.diff --]
[-- Type: text/plain, Size: 694 bytes --]

--- compat/siphash/siphash.c	2017-06-24 15:32:19.139482133 +0100
+++ compat/siphash/siphash.c	2017-06-24 15:30:09.205021457 +0100
@@ -13,7 +13,7 @@
 #include <linux/siphash.h>
 #include <asm/unaligned.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
+//#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
 #ifdef __LITTLE_ENDIAN
  #define HASH_LEN_DECLARE u32 hash; u32 len;
  #define bytemask_from_count(cnt)	(~(~0ul << (cnt)*8))
@@ -21,7 +21,7 @@
  #define HASH_LEN_DECLARE u32 len; u32 hash;
  #define bytemask_from_count(cnt)	(~(~0ul >> (cnt)*8))
 #endif
-#endif
+//#endif
 
 #if defined(CONFIG_DCACHE_WORD_ACCESS) && BITS_PER_LONG == 64
 #include <linux/dcache.h>

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2018-04-05 16:02 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-24 15:18 making wireguard work on RHEL7/etc wireguard
2017-06-26  8:07 ` Aaron Muir Hamilton
2017-06-26  8:19   ` wireguard
2017-06-26  9:04     ` Jason A. Donenfeld
2017-06-26  9:25       ` wireguard
2017-06-26  9:57         ` Jason A. Donenfeld
2017-06-26 10:47           ` Jason A. Donenfeld
2017-06-26 19:55             ` wireguard
2017-06-27 11:02               ` Jason A. Donenfeld
2017-06-26 20:45             ` wireguard
2017-06-27 11:05               ` Jason A. Donenfeld
2017-06-27 11:38                 ` wireguard
2017-06-27 19:23                   ` Jason A. Donenfeld
2017-06-27 19:43                     ` wireguard
2017-06-27 19:59                       ` Jason A. Donenfeld
2017-06-27 20:22                         ` Jason A. Donenfeld
2017-06-27 20:52                           ` Jason A. Donenfeld
2017-06-27 21:30                             ` wireguard
2017-06-27 22:09                               ` Jason A. Donenfeld
2017-06-27  5:35           ` Andrej Kacian
2017-06-27  7:25             ` wireguard
2017-06-27  9:39               ` Andrej Kacian
2017-06-27 11:08                 ` Jason A. Donenfeld
2018-04-05 15:08                   ` Daniel Kahn Gillmor
2018-04-05 16:15                     ` Daniel Kahn Gillmor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.