Skip to content

Commit 88bebdf

Browse files
zx2c4davem330
authored andcommitted
net: ipv4: 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: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b950d8a commit 88bebdf

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎net/ipv4/ip_output.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ static int ip_finish_output2(struct net *net, struct sock *sk, struct sk_buff *s
240240
static int ip_finish_output_gso(struct net *net, struct sock *sk,
241241
struct sk_buff *skb, unsigned int mtu)
242242
{
243+
struct sk_buff *segs, *nskb;
243244
netdev_features_t features;
244-
struct sk_buff *segs;
245245
int ret = 0;
246246

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

273273
consume_skb(skb);
274274

275-
do {
276-
struct sk_buff *nskb = segs->next;
275+
skb_list_walk_safe(segs, segs, nskb) {
277276
int err;
278277

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

282281
if (err && ret == 0)
283282
ret = err;
284-
segs = nskb;
285-
} while (segs);
283+
}
286284

287285
return ret;
288286
}

0 commit comments

Comments
 (0)