diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-05-29 22:05:37 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-05-30 18:07:28 +0200 |
commit | 54d591330a686ad5932447180b19c760e7f1f0be (patch) | |
tree | b13f81f4f10a6ea1e99c67625214e4f2a62a81de /src/device.c | |
parent | a98afbd958c3e37c6d5af4e04c094977a5e31306 (diff) |
device: keep going when share_check fails
Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/device.c b/src/device.c index a4a1104..f0c172f 100644 --- a/src/device.c +++ b/src/device.c @@ -131,6 +131,7 @@ static netdev_tx_t xmit(struct sk_buff *skb, struct net_device *dev) { struct wireguard_device *wg = netdev_priv(dev); struct wireguard_peer *peer; + struct sk_buff *next; int ret; if (unlikely(dev_recursion_level() > 4)) { @@ -172,8 +173,8 @@ static netdev_tx_t xmit(struct sk_buff *skb, struct net_device *dev) dev_kfree_skb(skb); skb = segs; } - while (skb) { - struct sk_buff *next = skb->next; + do { + next = skb->next; skb->next = skb->prev = NULL; skb = skb_share_check(skb, GFP_ATOMIC); @@ -185,8 +186,7 @@ static netdev_tx_t xmit(struct sk_buff *skb, struct net_device *dev) skb_dst_drop(skb); skb_queue_tail(&peer->tx_packet_queue, skb); - skb = next; - } + } while ((skb = next)); packet_send_queue(peer); peer_put(peer); |