diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-30 18:40:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-30 18:40:17 -0400 |
commit | e37a72de84d27ee8bc0e7dbb5c2f1774ed306dbb (patch) | |
tree | f9da35cbd79b52a5bd08d4a0f960bde6af741da0 /net/ipv4/tcp.c | |
parent | 93fdf10d4c28edaa1b9f80e7f9c3002359186d00 (diff) | |
parent | f83ef8c0b58dac17211a4c0b6df0e2b1bd6637b1 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[IPV6]: Added GSO support for TCPv6
[NET]: Generalise TSO-specific bits from skb_setup_caps
[IPV6]: Added GSO support for TCPv6
[IPV6]: Remove redundant length check on input
[NETFILTER]: SCTP conntrack: fix crash triggered by packet without chunks
[TG3]: Update version and reldate
[TG3]: Add TSO workaround using GSO
[TG3]: Turn on hw fix for ASF problems
[TG3]: Add rx BD workaround
[TG3]: Add tg3_netif_stop() in vlan functions
[TCP]: Reset gso_segs if packet is dodgy
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index a97450e9eb34..804458712d88 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -642,7 +642,7 @@ static inline int select_size(struct sock *sk, struct tcp_sock *tp) | |||
642 | int tmp = tp->mss_cache; | 642 | int tmp = tp->mss_cache; |
643 | 643 | ||
644 | if (sk->sk_route_caps & NETIF_F_SG) { | 644 | if (sk->sk_route_caps & NETIF_F_SG) { |
645 | if (sk->sk_route_caps & NETIF_F_TSO) | 645 | if (sk_can_gso(sk)) |
646 | tmp = 0; | 646 | tmp = 0; |
647 | else { | 647 | else { |
648 | int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER); | 648 | int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER); |
@@ -2165,13 +2165,19 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2165 | if (!pskb_may_pull(skb, thlen)) | 2165 | if (!pskb_may_pull(skb, thlen)) |
2166 | goto out; | 2166 | goto out; |
2167 | 2167 | ||
2168 | segs = NULL; | ||
2169 | if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) | ||
2170 | goto out; | ||
2171 | |||
2172 | oldlen = (u16)~skb->len; | 2168 | oldlen = (u16)~skb->len; |
2173 | __skb_pull(skb, thlen); | 2169 | __skb_pull(skb, thlen); |
2174 | 2170 | ||
2171 | if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) { | ||
2172 | /* Packet is from an untrusted source, reset gso_segs. */ | ||
2173 | int mss = skb_shinfo(skb)->gso_size; | ||
2174 | |||
2175 | skb_shinfo(skb)->gso_segs = (skb->len + mss - 1) / mss; | ||
2176 | |||
2177 | segs = NULL; | ||
2178 | goto out; | ||
2179 | } | ||
2180 | |||
2175 | segs = skb_segment(skb, features); | 2181 | segs = skb_segment(skb, features); |
2176 | if (IS_ERR(segs)) | 2182 | if (IS_ERR(segs)) |
2177 | goto out; | 2183 | goto out; |
@@ -2208,6 +2214,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2208 | out: | 2214 | out: |
2209 | return segs; | 2215 | return segs; |
2210 | } | 2216 | } |
2217 | EXPORT_SYMBOL(tcp_tso_segment); | ||
2211 | 2218 | ||
2212 | extern void __skb_cb_too_small_for_tcp(int, int); | 2219 | extern void __skb_cb_too_small_for_tcp(int, int); |
2213 | extern struct tcp_congestion_ops tcp_reno; | 2220 | extern struct tcp_congestion_ops tcp_reno; |