summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-01-10 19:11:46 -0500
committerJason A. Donenfeld <Jason@zx2c4.com>2020-01-11 10:49:18 -0500
commita3f8970c8181f44091f987679527e41fa6531d68 (patch)
treea3822f9b80283a740aa6d55948c29f8228dbddef
parentMakefile: strip prefixed v from version.h (diff)
downloadwireguard-linux-compat-a3f8970c8181f44091f987679527e41fa6531d68.tar.xz
wireguard-linux-compat-a3f8970c8181f44091f987679527e41fa6531d68.zip
device: skb_list_walk_safe moved upstream
This won't be ported to 5.6, of course, but it's still cleaner to get this out of the way. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/compat/compat.h9
-rw-r--r--src/device.h8
2 files changed, 9 insertions, 8 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index 824f57c..96f3556 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -865,6 +865,15 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
#define ipv6_dst_lookup_flow(a, b, c, d) ipv6_dst_lookup(a, b, &dst, c) + (void *)0 ?: dst
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
+#include <linux/skbuff.h>
+#ifndef skb_list_walk_safe
+#define skb_list_walk_safe(first, skb, next) \
+ for ((skb) = (first), (next) = (skb) ? (skb)->next : NULL; (skb); \
+ (skb) = (next), (next) = (skb) ? (skb)->next : NULL)
+#endif
+#endif
+
#if defined(ISUBUNTU1604)
#include <linux/siphash.h>
#ifndef _WG_LINUX_SIPHASH_H
diff --git a/src/device.h b/src/device.h
index c91f305..b15a8be 100644
--- a/src/device.h
+++ b/src/device.h
@@ -62,12 +62,4 @@ struct wg_device {
int wg_device_init(void);
void wg_device_uninit(void);
-/* Later after the dust settles, this can be moved into include/linux/skbuff.h,
- * where virtually all code that deals with GSO segs can benefit, around ~30
- * drivers as of writing.
- */
-#define skb_list_walk_safe(first, skb, next) \
- for (skb = first, next = skb->next; skb; \
- skb = next, next = skb ? skb->next : NULL)
-
#endif /* _WG_DEVICE_H */