diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index be354155b2f93331ac0071bfcb1af879fd2d46ff..2ba73bf3a8f9304c0212a6df0969acdda3b0d943 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) { int tmp = tp->mss_cache_std; - if (sk->sk_route_caps & NETIF_F_SG) - tmp = 0; + if (sk->sk_route_caps & NETIF_F_SG) { + if (sk->sk_route_caps & NETIF_F_TSO) + tmp = 0; + else { + int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER); + + if (tmp >= pgbreak && + tmp <= pgbreak + (MAX_SKB_FRAGS - 1) * PAGE_SIZE) + tmp = pgbreak; + } + } return tmp; }