All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/2] udp: using datalen to cap ipv6 udp max gso segments
@ 2021-12-23 22:24 Coco Li
  2021-12-23 22:24 ` [PATCH net 2/2] selftests: Calculate udpgso segment count without header adjustment Coco Li
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Coco Li @ 2021-12-23 22:24 UTC (permalink / raw)
  To: netdev; +Cc: David S . Miller, Coco Li, Willem de Bruijn

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")
Signed-off-by: Coco Li <lixiaoyan@google.com>
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;
 		}
-- 
2.34.1.448.ga2b2bfdf31-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-24  3:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-23 22:24 [PATCH net 1/2] udp: using datalen to cap ipv6 udp max gso segments Coco Li
2021-12-23 22:24 ` [PATCH net 2/2] selftests: Calculate udpgso segment count without header adjustment Coco Li
2021-12-24  3:19 ` [PATCH net 1/2] udp: using datalen to cap ipv6 udp max gso segments Jakub Kicinski
2021-12-24  3:22   ` Jakub Kicinski
2021-12-24  3:48     ` Willem de Bruijn
2021-12-24  3:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.