From ec1fb51edfb56d39a1c9e8717dc25a5c86252555 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Tue, 30 Jun 2009 12:55:48 +0100 Subject: [PATCH] It is possible for a frontend to generate a TSO request which doesn't actually need segmentation (i.e. with size < MTU). Make sure this doesn't crash the backend. --- net/ipv4/tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 036dee65..634dffc5 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2439,7 +2439,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) th = tcp_hdr(skb); seq = ntohl(th->seq); - do { + while (skb->next) { th->fin = th->psh = 0; th->check = ~csum_fold((__force __wsum)((__force u32)th->check + @@ -2455,7 +2455,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) th->seq = htonl(seq); th->cwr = 0; - } while (skb->next); + } delta = htonl(oldlen + (skb->tail - skb->transport_header) + skb->data_len); -- 2.39.5