All of lore.kernel.org
 help / color / mirror / Atom feed
From: wireguard@wut.to
To: wireguard@lists.zx2c4.com
Subject: making wireguard work on RHEL7/etc.
Date: Sat, 24 Jun 2017 16:18:51 +0100 (BST)	[thread overview]
Message-ID: <alpine.LRH.2.20.1706241613350.14074@bcny.fcbq.bet> (raw)

[-- 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>

             reply	other threads:[~2017-06-24 15:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-24 15:18 wireguard [this message]
2017-06-26  8:07 ` making wireguard work on RHEL7/etc 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.20.1706241613350.14074@bcny.fcbq.bet \
    --to=wireguard@wut.to \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.