summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/compat/compat.h8
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"