Skip to content

Commit

Permalink
net: ipv4: use skb_list_walk_safe helper for gso segments
Browse files Browse the repository at this point in the history
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: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jason A. Donenfeld authored and David S. Miller committed Jan 14, 2020
1 parent b950d8a commit 88bebdf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ static int ip_finish_output2(struct net *net, struct sock *sk, struct sk_buff *s
static int ip_finish_output_gso(struct net *net, struct sock *sk,
struct sk_buff *skb, unsigned int mtu)
{
struct sk_buff *segs, *nskb;
netdev_features_t features;
struct sk_buff *segs;
int ret = 0;

/* common case: seglen is <= mtu
Expand Down Expand Up @@ -272,17 +272,15 @@ static int ip_finish_output_gso(struct net *net, struct sock *sk,

consume_skb(skb);

do {
struct sk_buff *nskb = segs->next;
skb_list_walk_safe(segs, segs, nskb) {
int err;

skb_mark_not_on_list(segs);
err = ip_fragment(net, sk, segs, mtu, ip_finish_output2);

if (err && ret == 0)
ret = err;
segs = nskb;
} while (segs);
}

return ret;
}
Expand Down

0 comments on commit 88bebdf

Please sign in to comment.