diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-20 10:11:15 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-24 11:19:18 +0200 |
commit | 314754d7b5cfe6a98b026dbb9f7157d1a7240aad (patch) | |
tree | 7d7c708f02251358bc92183b3e3b96786d4eca5e /src | |
parent | wg-quick: darwin: support being called from launchd (diff) | |
download | wireguard-monolithic-historical-314754d7b5cfe6a98b026dbb9f7157d1a7240aad.tar.xz wireguard-monolithic-historical-314754d7b5cfe6a98b026dbb9f7157d1a7240aad.zip |
compat: some kernels weirdly backport prandom_u32_max
Diffstat (limited to 'src')
-rw-r--r-- | src/compat/compat.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index 861601c..5b28928 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -216,10 +216,11 @@ static inline void skb_scrub_packet(struct sk_buff *skb, bool xnet) #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) || defined(ISUBUNTU1404)) && !defined(ISRHEL7) #include <linux/random.h> -static inline u32 prandom_u32_max(u32 ep_ro) +static inline u32 __wgcompat_prandom_u32_max(u32 ep_ro) { - return (u32)(((u64) prandom_u32() * ep_ro) >> 32); + return (u32)(((u64)prandom_u32() * ep_ro) >> 32); } +#define prandom_u32_max __wgcompat_prandom_u32_max #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 75) && !defined(ISRHEL7) |