diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-07-28 00:59:44 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-07-28 00:59:44 +0200 |
commit | 42ef0150736a691224724594653c998962f315e5 (patch) | |
tree | 4194c66d03871dd62d39920ddafc11a948b03ac6 /src/compat/compat.h | |
parent | recieve: cleanup variable usage (diff) | |
download | wireguard-monolithic-historical-42ef0150736a691224724594653c998962f315e5.tar.xz wireguard-monolithic-historical-42ef0150736a691224724594653c998962f315e5.zip |
compat: get rid of warnings on frankenkernels
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r-- | src/compat/compat.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index 67240ce..e9ea77b 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -138,9 +138,16 @@ static inline void netif_keep_dst(struct net_device *dev) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) && !defined(ISRHEL7) +#include <linux/netdevice.h> +#ifndef netdev_alloc_pcpu_stats #define pcpu_sw_netstats pcpu_tstats +#endif +#ifndef netdev_alloc_pcpu_stats #define netdev_alloc_pcpu_stats alloc_percpu +#endif #elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && !defined(ISRHEL7) +#include <linux/netdevice.h> +#ifndef netdev_alloc_pcpu_stats #define netdev_alloc_pcpu_stats(type) \ ({ \ typeof(type) __percpu *pcpu_stats = alloc_percpu(type); \ @@ -155,6 +162,7 @@ static inline void netif_keep_dst(struct net_device *dev) pcpu_stats; \ }) #endif +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) #include "checksum/checksum_partial_compat.h" |