summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-02-27 14:07:22 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2017-02-27 15:03:15 -0800
commit6a41b506df7a63f8fb550a29529e54bd9afa90d2 (patch)
tree486f69b92396bd7056657157e97eaf7fee8a4836 /src
parentdevice: move sysctl toggling to open time (diff)
downloadwireguard-monolithic-historical-6a41b506df7a63f8fb550a29529e54bd9afa90d2.tar.xz
wireguard-monolithic-historical-6a41b506df7a63f8fb550a29529e54bd9afa90d2.zip
data: transition to skb_reset_tc for 4.11
Diffstat (limited to 'src')
-rw-r--r--src/compat/compat.h10
-rw-r--r--src/data.c4
2 files changed, 11 insertions, 3 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index 277e7e7..c3b4289 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -161,6 +161,16 @@ static inline bool ipv6_mod_enabled(void)
}
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+#include <linux/skbuff.h>
+static inline void skb_reset_tc(struct sk_buff *skb)
+{
+#ifdef CONFIG_NET_CLS_ACT
+ skb->tc_verd = 0;
+#endif
+}
+#endif
+
/* https://lkml.org/lkml/2015/6/12/415 */
#include <linux/netdevice.h>
static inline struct net_device *netdev_pub(void *dev)
diff --git a/src/data.c b/src/data.c
index 6cc6ce4..e91b150 100644
--- a/src/data.c
+++ b/src/data.c
@@ -124,9 +124,7 @@ static inline void skb_reset(struct sk_buff *skb)
skb->dev = NULL;
#ifdef CONFIG_NET_SCHED
skb->tc_index = 0;
-#ifdef CONFIG_NET_CLS_ACT
- skb->tc_verd = 0;
-#endif
+ skb_reset_tc(skb);
#endif
skb->hdr_len = skb_headroom(skb);
skb_reset_mac_header(skb);