ia64/xen-unstable

changeset 10611:f147efaa24ad

[NET]: Add net-tso.patch

This patch has been submitted upstream for review. It resets gso_segs for
TSO.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jun 30 09:52:04 2006 +0100 (2006-06-30)
parents 88dc1ae16d2b
children 5db7bbccf4d2
files patches/linux-2.6.16.13/net-tso.patch
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/linux-2.6.16.13/net-tso.patch	Fri Jun 30 09:52:04 2006 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
     1.5 +index 0336422..0bb0ac9 100644
     1.6 +--- a/net/ipv4/tcp.c
     1.7 ++++ b/net/ipv4/tcp.c
     1.8 +@@ -2166,13 +2166,19 @@ struct sk_buff *tcp_tso_segment(struct s
     1.9 + 	if (!pskb_may_pull(skb, thlen))
    1.10 + 		goto out;
    1.11 + 
    1.12 +-	segs = NULL;
    1.13 +-	if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST))
    1.14 +-		goto out;
    1.15 +-
    1.16 + 	oldlen = (u16)~skb->len;
    1.17 + 	__skb_pull(skb, thlen);
    1.18 + 
    1.19 ++	if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
    1.20 ++		/* Packet is from an untrusted source, reset gso_segs. */
    1.21 ++		int mss = skb_shinfo(skb)->gso_size;
    1.22 ++
    1.23 ++		skb_shinfo(skb)->gso_segs = (skb->len + mss - 1) / mss;
    1.24 ++
    1.25 ++		segs = NULL;
    1.26 ++		goto out;
    1.27 ++	}
    1.28 ++
    1.29 + 	segs = skb_segment(skb, features);
    1.30 + 	if (IS_ERR(segs))
    1.31 + 		goto out;