aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-07-03 13:49:45 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-07-03 13:49:45 -0400
commit026477c1141b67e98e3bd8bdedb7d4b88a3ecd09 (patch)
tree2624a44924c625c367f3cebf937853b9da2de282 /net/ipv4/tcp.c
parent9f2fa466383ce100b90fe52cb4489d7a26bf72a9 (diff)
parent29454dde27d8e340bb1987bad9aa504af7081eba (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c18
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,
2145EXPORT_SYMBOL(compat_tcp_getsockopt); 2144EXPORT_SYMBOL(compat_tcp_getsockopt);
2146#endif 2145#endif
2147 2146
2148struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg) 2147struct 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)
2205out: 2214out:
2206 return segs; 2215 return segs;
2207} 2216}
2217EXPORT_SYMBOL(tcp_tso_segment);
2208 2218
2209extern void __skb_cb_too_small_for_tcp(int, int); 2219extern void __skb_cb_too_small_for_tcp(int, int);
2210extern struct tcp_congestion_ops tcp_reno; 2220extern struct tcp_congestion_ops tcp_reno;