From 314754d7b5cfe6a98b026dbb9f7157d1a7240aad Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 20 Jun 2019 10:11:15 +0200 Subject: compat: some kernels weirdly backport prandom_u32_max --- src/compat/compat.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/compat/compat.h') 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 -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) -- cgit v1.2.3-59-g8ed1b