Commit 2670ee77 authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by David S. Miller

net: netfilter: use skb_list_walk_safe helper for gso segments

This is a straight-forward conversion case for the new function, keeping
the flow of the existing code as intact as possible.
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 88bebdf5
...@@ -778,7 +778,7 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum) ...@@ -778,7 +778,7 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
{ {
unsigned int queued; unsigned int queued;
struct nfqnl_instance *queue; struct nfqnl_instance *queue;
struct sk_buff *skb, *segs; struct sk_buff *skb, *segs, *nskb;
int err = -ENOBUFS; int err = -ENOBUFS;
struct net *net = entry->state.net; struct net *net = entry->state.net;
struct nfnl_queue_net *q = nfnl_queue_pernet(net); struct nfnl_queue_net *q = nfnl_queue_pernet(net);
...@@ -815,8 +815,7 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum) ...@@ -815,8 +815,7 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
goto out_err; goto out_err;
queued = 0; queued = 0;
err = 0; err = 0;
do { skb_list_walk_safe(segs, segs, nskb) {
struct sk_buff *nskb = segs->next;
if (err == 0) if (err == 0)
err = __nfqnl_enqueue_packet_gso(net, queue, err = __nfqnl_enqueue_packet_gso(net, queue,
segs, entry); segs, entry);
...@@ -824,8 +823,7 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum) ...@@ -824,8 +823,7 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
queued++; queued++;
else else
kfree_skb(segs); kfree_skb(segs);
segs = nskb; }
} while (segs);
if (queued) { if (queued) {
if (err) /* some segments are already queued */ if (err) /* some segments are already queued */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment