diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-28 19:49:30 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-28 19:56:04 -0600 |
commit | 2d4fa2a6e7903ec3340f1b075456cbd84ba6a744 (patch) | |
tree | d5137425a403fd82b88c3a43d050887890108bc3 | |
parent | cf877de9a8b38422aef6beb514b688a0eedae4d8 (diff) |
queueing: backport skb_reset_redirect change from 5.6
This backports upstream commit 2c64605b590edadb3fb46d1ec6badb49e940b479.
It makes no difference for us, but it's nice to keep this code in sync
with upstream as much as possible.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | src/compat/compat.h | 10 | ||||
-rw-r--r-- | src/queueing.h | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index 42f7bee..fe2d07e 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -1024,6 +1024,16 @@ out: #define COMPAT_CANNOT_USE_MAX_MTU #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) +#include <linux/skbuff.h> +static inline void skb_reset_redirect(struct sk_buff *skb) +{ +#ifdef CONFIG_NET_SCHED + skb_reset_tc(skb); +#endif +} +#endif + #if defined(ISUBUNTU1604) #include <linux/siphash.h> #ifndef _WG_LINUX_SIPHASH_H diff --git a/src/queueing.h b/src/queueing.h index 256c6be..fe6e5c9 100644 --- a/src/queueing.h +++ b/src/queueing.h @@ -103,8 +103,8 @@ static inline void wg_reset_packet(struct sk_buff *skb) skb->dev = NULL; #ifdef CONFIG_NET_SCHED skb->tc_index = 0; - skb_reset_tc(skb); #endif + skb_reset_redirect(skb); skb->hdr_len = skb_headroom(skb); skb_reset_mac_header(skb); skb_reset_network_header(skb); |