Skip to content

Commit 736ef37

Browse files
xli98kuba-moo
authored andcommitted
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: 158390e ("udp: using datalen to cap max gso segments") Signed-off-by: Coco Li <lixiaoyan@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/20211223222441.2975883-1-lixiaoyan@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 6f6f0ac commit 736ef37

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/ipv6/udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6,
12041204
kfree_skb(skb);
12051205
return -EINVAL;
12061206
}
1207-
if (skb->len > cork->gso_size * UDP_MAX_SEGMENTS) {
1207+
if (datalen > cork->gso_size * UDP_MAX_SEGMENTS) {
12081208
kfree_skb(skb);
12091209
return -EINVAL;
12101210
}

0 commit comments

Comments
 (0)