Commit 736ef37f authored by Coco Li's avatar Coco Li Committed by Jakub Kicinski

udp: using datalen to cap ipv6 udp max gso segments

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: 158390e4 ("udp: using datalen to cap max gso segments")
Signed-off-by: default avatarCoco Li <lixiaoyan@google.com>
Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20211223222441.2975883-1-lixiaoyan@google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6f6f0ac6
...@@ -1204,7 +1204,7 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6, ...@@ -1204,7 +1204,7 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6,
kfree_skb(skb); kfree_skb(skb);
return -EINVAL; return -EINVAL;
} }
if (skb->len > cork->gso_size * UDP_MAX_SEGMENTS) { if (datalen > cork->gso_size * UDP_MAX_SEGMENTS) {
kfree_skb(skb); kfree_skb(skb);
return -EINVAL; return -EINVAL;
} }
......
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