aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/device.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-11-29 04:47:27 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-12-05 11:48:25 +0100
commite1d3e7635f3fd22ec216805a22f63e8002863af8 (patch)
treec633665f394d5ae511a4ee668816cbe0766329d9 /src/device.h
parentsend: use kfree_skb_list (diff)
downloadwireguard-monolithic-historical-e1d3e7635f3fd22ec216805a22f63e8002863af8.tar.xz
wireguard-monolithic-historical-e1d3e7635f3fd22ec216805a22f63e8002863af8.zip
device: prepare skb_list_walk_safe for upstreaming
Diffstat (limited to 'src/device.h')
-rw-r--r--src/device.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/device.h b/src/device.h
index b15a8be..c91f305 100644
--- a/src/device.h
+++ b/src/device.h
@@ -62,4 +62,12 @@ 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 */