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 | 83477092d2f93970974c75c890157eb34db48b9b (patch) | |
tree | aa988d5a7e755e1563f7ccb4784281a697c14772 /src | |
parent | 64dc454fe3ce8ce9130403ae802ca5facaf5b8aa (diff) |
compat: get rid of warnings on frankenkernels
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-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" |