Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[firefly-linux-kernel-4.4.55.git] / net / ipv4 / tcp_output.c
index e70a6840cb6483c2fbfd03249c03413a6a6500f5..53232dd6fb48af5a9c4f5d2373a1630936bb7980 100644 (file)
@@ -40,7 +40,6 @@
 
 #include <linux/compiler.h>
 #include <linux/module.h>
-#include <linux/smp_lock.h>
 
 /* People can turn this off for buggy TCP's found in printers etc. */
 int sysctl_tcp_retrans_collapse __read_mostly = 1;
@@ -1035,8 +1034,10 @@ static inline int tcp_nagle_test(struct tcp_sock *tp, struct sk_buff *skb,
        if (nonagle & TCP_NAGLE_PUSH)
                return 1;
 
-       /* Don't use the nagle rule for urgent data (or for the final FIN).  */
-       if (tp->urg_mode ||
+       /* Don't use the nagle rule for urgent data (or for the final FIN).
+        * Nagle can be ignored during F-RTO too (see RFC4138).
+        */
+       if (tp->urg_mode || (tp->frto_counter == 2) ||
            (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN))
                return 1;
 
@@ -2035,7 +2036,7 @@ void tcp_send_fin(struct sock *sk)
 /* We get here when a process closes a file descriptor (either due to
  * an explicit close() or as a byproduct of exit()'ing) and there
  * was unread data in the receive queue.  This behavior is recommended
- * by draft-ietf-tcpimpl-prob-03.txt section 3.10.  -DaveM
+ * by RFC 2525, section 2.17.  -DaveM
  */
 void tcp_send_active_reset(struct sock *sk, gfp_t priority)
 {