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 | 9ec886debd4766d87d640f00f150fea5b1844e8d (patch) | |
tree | bbb7554adb986fb1efb3c3654ac5527f69861f4d | |
parent | 9a21aae6d36ee514858b5dd4d1ed2b94c37a2fbd (diff) |
compat: some kernels weirdly backport prandom_u32_max
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-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) |