direct-io.hg

view patches/linux-2.6.16.13/net-gso-1-check-dodgy.patch @ 10720:d48322cddd87

Split networking GSO patch into base portion plus additions.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Jul 25 15:06:39 2006 +0100 (2006-07-25)
parents
children
line source
1 diff -urp a/net/ipv4/tcp.c b/net/ipv4/tcp.c
2 --- a/net/ipv4/tcp.c 2006-07-25 14:42:53.194910626 +0100
3 +++ b/net/ipv4/tcp.c 2006-07-25 14:41:00.955501910 +0100
4 @@ -2042,13 +2042,19 @@ struct sk_buff *tcp_tso_segment(struct s
5 if (!pskb_may_pull(skb, thlen))
6 goto out;
8 - segs = NULL;
9 - if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST))
10 - goto out;
11 -
12 oldlen = (u16)~skb->len;
13 __skb_pull(skb, thlen);
15 + if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
16 + /* Packet is from an untrusted source, reset gso_segs. */
17 + int mss = skb_shinfo(skb)->gso_size;
18 +
19 + skb_shinfo(skb)->gso_segs = (skb->len + mss - 1) / mss;
20 +
21 + segs = NULL;
22 + goto out;
23 + }
24 +
25 segs = skb_segment(skb, features);
26 if (IS_ERR(segs))
27 goto out;