aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-05-20 08:46:47 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-05-20 00:47:28 -0600
commitf3a500fab070c1adfda2fc2bb26d0dab2b2b1248 (patch)
treea18da364695a71e02971f0edebf2a30df5f1503c /src
parentnoise: separate receive counter from send counter (diff)
downloadwireguard-linux-compat-f3a500fab070c1adfda2fc2bb26d0dab2b2b1248.tar.xz
wireguard-linux-compat-f3a500fab070c1adfda2fc2bb26d0dab2b2b1248.zip
compat: backport renamed/missing skb hash members
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/compat/compat.h13
-rw-r--r--src/queueing.h4
2 files changed, 15 insertions, 2 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index dbb52d8..d6b5f31 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -1026,6 +1026,19 @@ static inline void skb_reset_redirect(struct sk_buff *skb)
}
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
+#define skb_get_hash skb_get_rxhash
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
+#define hash rxhash
+#define l4_hash l4_rxhash
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
+#define sw_hash ignore_df = 0; skb->nf_trace = skb->ooo_okay
+#endif
+
#if defined(ISUBUNTU1604) || defined(ISRHEL7)
#include <linux/siphash.h>
#ifndef _WG_LINUX_SIPHASH_H
diff --git a/src/queueing.h b/src/queueing.h
index ebad8d2..e88eb93 100644
--- a/src/queueing.h
+++ b/src/queueing.h
@@ -90,9 +90,9 @@ static inline bool wg_check_packet_protocol(struct sk_buff *skb)
static inline void wg_reset_packet(struct sk_buff *skb, bool encapsulating)
{
const int pfmemalloc = skb->pfmemalloc;
+ u32 hash = skb->hash;
u8 l4_hash = skb->l4_hash;
u8 sw_hash = skb->sw_hash;
- u32 hash = skb->hash;
skb_scrub_packet(skb, true);
memset(&skb->headers_start, 0,
@@ -100,9 +100,9 @@ static inline void wg_reset_packet(struct sk_buff *skb, bool encapsulating)
offsetof(struct sk_buff, headers_start));
skb->pfmemalloc = pfmemalloc;
if (encapsulating) {
+ skb->hash = hash;
skb->l4_hash = l4_hash;
skb->sw_hash = sw_hash;
- skb->hash = hash;
}
skb->queue_mapping = 0;
skb->nohdr = 0;