aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/device.c
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.c
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.c')
-rw-r--r--src/device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c
index 532d399..e888ac3 100644
--- a/src/device.c
+++ b/src/device.c
@@ -171,8 +171,8 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb(skb);
skb = segs;
}
- do {
- next = skb->next;
+
+ skb_list_walk_safe(skb, skb, next) {
skb_mark_not_on_list(skb);
skb = skb_share_check(skb, GFP_ATOMIC);
@@ -187,7 +187,7 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev)
PACKET_CB(skb)->mtu = mtu;
__skb_queue_tail(&packets, skb);
- } while ((skb = next) != NULL);
+ }
spin_lock_bh(&peer->staged_packet_queue.lock);
/* If the queue is getting too big, we start removing the oldest packets