diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-03 13:49:45 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-03 13:49:45 -0400 |
commit | 026477c1141b67e98e3bd8bdedb7d4b88a3ecd09 (patch) | |
tree | 2624a44924c625c367f3cebf937853b9da2de282 /net/ipv4/tcp.c | |
parent | 9f2fa466383ce100b90fe52cb4489d7a26bf72a9 (diff) | |
parent | 29454dde27d8e340bb1987bad9aa504af7081eba (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index c04176be7ed1..804458712d88 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -247,7 +247,6 @@ | |||
247 | * TCP_CLOSE socket is finished | 247 | * TCP_CLOSE socket is finished |
248 | */ | 248 | */ |
249 | 249 | ||
250 | #include <linux/config.h> | ||
251 | #include <linux/module.h> | 250 | #include <linux/module.h> |
252 | #include <linux/types.h> | 251 | #include <linux/types.h> |
253 | #include <linux/fcntl.h> | 252 | #include <linux/fcntl.h> |
@@ -643,7 +642,7 @@ static inline int select_size(struct sock *sk, struct tcp_sock *tp) | |||
643 | int tmp = tp->mss_cache; | 642 | int tmp = tp->mss_cache; |
644 | 643 | ||
645 | if (sk->sk_route_caps & NETIF_F_SG) { | 644 | if (sk->sk_route_caps & NETIF_F_SG) { |
646 | if (sk->sk_route_caps & NETIF_F_TSO) | 645 | if (sk_can_gso(sk)) |
647 | tmp = 0; | 646 | tmp = 0; |
648 | else { | 647 | else { |
649 | int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER); | 648 | int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER); |
@@ -2145,7 +2144,7 @@ int compat_tcp_getsockopt(struct sock *sk, int level, int optname, | |||
2145 | EXPORT_SYMBOL(compat_tcp_getsockopt); | 2144 | EXPORT_SYMBOL(compat_tcp_getsockopt); |
2146 | #endif | 2145 | #endif |
2147 | 2146 | ||
2148 | struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg) | 2147 | struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) |
2149 | { | 2148 | { |
2150 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 2149 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
2151 | struct tcphdr *th; | 2150 | struct tcphdr *th; |
@@ -2169,7 +2168,17 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg) | |||
2169 | oldlen = (u16)~skb->len; | 2168 | oldlen = (u16)~skb->len; |
2170 | __skb_pull(skb, thlen); | 2169 | __skb_pull(skb, thlen); |
2171 | 2170 | ||
2172 | segs = skb_segment(skb, sg); | 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 | |||
2181 | segs = skb_segment(skb, features); | ||
2173 | if (IS_ERR(segs)) | 2182 | if (IS_ERR(segs)) |
2174 | goto out; | 2183 | goto out; |
2175 | 2184 | ||
@@ -2205,6 +2214,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg) | |||
2205 | out: | 2214 | out: |
2206 | return segs; | 2215 | return segs; |
2207 | } | 2216 | } |
2217 | EXPORT_SYMBOL(tcp_tso_segment); | ||
2208 | 2218 | ||
2209 | extern void __skb_cb_too_small_for_tcp(int, int); | 2219 | extern void __skb_cb_too_small_for_tcp(int, int); |
2210 | extern struct tcp_congestion_ops tcp_reno; | 2220 | extern struct tcp_congestion_ops tcp_reno; |