aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/tcp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index be354155b2f9..2ba73bf3a8f9 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -756,8 +756,17 @@ static inline int select_size(struct sock *sk, struct tcp_sock *tp)
756{ 756{
757 int tmp = tp->mss_cache_std; 757 int tmp = tp->mss_cache_std;
758 758
759 if (sk->sk_route_caps & NETIF_F_SG) 759 if (sk->sk_route_caps & NETIF_F_SG) {
760 tmp = 0; 760 if (sk->sk_route_caps & NETIF_F_TSO)
761 tmp = 0;
762 else {
763 int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER);
764
765 if (tmp >= pgbreak &&
766 tmp <= pgbreak + (MAX_SKB_FRAGS - 1) * PAGE_SIZE)
767 tmp = pgbreak;
768 }
769 }
761 770
762 return tmp; 771 return tmp;
763} 772}