Re: [PATCH net 1/2] udp: using datalen to cap ipv6 udp max gso segments
flat view
From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-12-24 03:19:25
On Thu, 23 Dec 2021 22:24:40 +0000 Coco Li wrote:
The max number of UDP gso segments is intended to cap to
UDP_MAX_SEGMENTS, this is checked in udp_send_skb().
skb->len contains network and transport header len here, we should use
only data len instead.
This is the ipv6 counterpart to the below referenced commit,
which missed the ipv6 change
Fixes: 158390e45612 ("udp: using datalen to cap max gso segments")
I'm gonna replace the Fixes tag with:
Fixes: bec1f6f69736 ("udp: generate gso with UDP_SEGMENT")
hope that's okay.
quoted hunk ↗ jump to hunk
Signed-off-by: Coco Li <redacted> Reviewed-by: Willem de Bruijn <willemb@google.com> --- net/ipv6/udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index a2caca6ccf11..8cde9efd7919 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c@@ -1204,7 +1204,7 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6, kfree_skb(skb); return -EINVAL; } - if (skb->len > cork->gso_size * UDP_MAX_SEGMENTS) { + if (datalen > cork->gso_size * UDP_MAX_SEGMENTS) { kfree_skb(skb); return -EINVAL; }