From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: davem@davemloft.net, johannes@sipsolutions.net, netdev@vger.kernel.org
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Subject: [PATCH net-next 2/8] net: udp: use skb_list_walk_safe helper for gso segments
Date: Mon, 13 Jan 2020 18:42:27 -0500 [thread overview]
Message-ID: <20200113234233.33886-3-Jason@zx2c4.com> (raw)
In-Reply-To: <20200113234233.33886-1-Jason@zx2c4.com>
This is a straight-forward conversion case for the new function,
iterating over the return value from udp_rcv_segment, which actually is
a wrapper around skb_gso_segment.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
net/ipv4/udp.c | 3 +--
net/ipv6/udp.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 93a355b6b092..208da0917469 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2104,8 +2104,7 @@ static int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
BUILD_BUG_ON(sizeof(struct udp_skb_cb) > SKB_SGO_CB_OFFSET);
__skb_push(skb, -skb_mac_offset(skb));
segs = udp_rcv_segment(sk, skb, true);
- for (skb = segs; skb; skb = next) {
- next = skb->next;
+ skb_list_walk_safe(segs, skb, next) {
__skb_pull(skb, skb_transport_offset(skb));
ret = udp_queue_rcv_one_skb(sk, skb);
if (ret > 0)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 9fec580c968e..5dc439a391fe 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -690,8 +690,7 @@ static int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
__skb_push(skb, -skb_mac_offset(skb));
segs = udp_rcv_segment(sk, skb, false);
- for (skb = segs; skb; skb = next) {
- next = skb->next;
+ skb_list_walk_safe(segs, skb, next) {
__skb_pull(skb, skb_transport_offset(skb));
ret = udpv6_queue_rcv_one_skb(sk, skb);
--
2.24.1
next prev parent reply other threads:[~2020-01-13 23:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-13 23:42 [PATCH net-next 0/8] skb_list_walk_safe refactoring for net/*'s skb_gso_segment usage Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 1/8] net: skbuff: disambiguate argument and member for skb_list_walk_safe helper Jason A. Donenfeld
2020-01-13 23:42 ` Jason A. Donenfeld [this message]
2020-01-13 23:42 ` [PATCH net-next 3/8] net: xfrm: use skb_list_walk_safe helper for gso segments Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 4/8] net: openvswitch: " Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 5/8] net: sched: " Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 6/8] net: ipv4: " Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 7/8] net: netfilter: " Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 8/8] net: mac80211: " Jason A. Donenfeld
2020-01-14 19:49 ` [PATCH net-next 0/8] skb_list_walk_safe refactoring for net/*'s skb_gso_segment usage David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200113234233.33886-3-Jason@zx2c4.com \
--to=jason@zx2c4.com \
--cc=davem@davemloft.net \
--cc=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).