summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-20 22:18:18 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-22 16:41:59 +0200
commitbe1b155d3ab06e08cf2cb4c1ede684cfce8d8c82 (patch)
treea3c20f1edd4e2e3822c54e6030a8847f26af8dde /src
parentdb86d52276c6560457ea41026311a3aa1248ebc0 (diff)
compat: work around qcom 4.9 backports
Qualcomm backported the get_random_u32 patch, even though kernel.org didn't, which is a problem. They also backported another patch in the same place which defines a new macro variable, so use this as a differentiator. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/compat/compat.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index e077188..1b6459d 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -124,6 +124,8 @@ static inline void skb_reset_tc(struct sk_buff *skb)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+#include <linux/random.h>
+#ifndef CANARY_MASK
#include <linux/siphash.h>
static inline u32 get_random_u32(void)
{
@@ -141,6 +143,7 @@ static inline u32 get_random_u32(void)
return siphash_2u32(counter++, get_random_int(), &key);
}
#endif
+#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(ISRHEL7)
static inline void netif_keep_dst(struct net_device *dev)