diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-24 04:41:46 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-24 04:42:37 +0200 |
commit | a969a6d4c4f7f2df80e28165b4442263fcbf089d (patch) | |
tree | e438396e47ad7719a7e54f09e2f35b63663d6900 /src/compat/compat.h | |
parent | version: bump snapshot (diff) | |
download | wireguard-monolithic-historical-a969a6d4c4f7f2df80e28165b4442263fcbf089d.tar.xz wireguard-monolithic-historical-a969a6d4c4f7f2df80e28165b4442263fcbf089d.zip |
compat: don't clash with get_random_u32 backports
Our previous heuristic wasn't good enough, since CopperheadOS backported
CANARY_MASK without backporting get_random_u32, as Qualcomm did, so now
we just entirely rename all invocations of the function.
Diffstat (limited to '')
-rw-r--r-- | src/compat/compat.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index 1b6459d..2853c09 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -125,9 +125,8 @@ static inline void skb_reset_tc(struct sk_buff *skb) #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) +static inline u32 __wgcompat_get_random_u32(void) { static siphash_key_t key; static u32 counter = 0; @@ -142,7 +141,7 @@ static inline u32 get_random_u32(void) #endif return siphash_2u32(counter++, get_random_int(), &key); } -#endif +#define get_random_u32 __wgcompat_get_random_u32 #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(ISRHEL7) |