OSDN Git Service

tcp: refine memory limit test in tcp_fragment()
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / net / ipv4 / tcp_output.c
index bed8399..53edd60 100644 (file)
@@ -1161,7 +1161,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len,
        if (nsize < 0)
                nsize = 0;
 
-       if (unlikely((sk->sk_wmem_queued >> 1) > sk->sk_sndbuf)) {
+       if (unlikely((sk->sk_wmem_queued >> 1) > sk->sk_sndbuf + 0x20000)) {
                NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPWQUEUETOOBIG);
                return -ENOMEM;
        }