Merge master.kernel.org:/home/rmk/linux-2.6-arm
[powerpc.git] / net / ipv4 / tcp_output.c
index 5dd6dd7..caf2e2c 100644 (file)
@@ -190,15 +190,16 @@ void tcp_select_initial_window(int __space, __u32 mss,
        }
 
        /* Set initial window to value enough for senders,
-        * following RFC1414. Senders, not following this RFC,
+        * following RFC2414. Senders, not following this RFC,
         * will be satisfied with 2.
         */
        if (mss > (1<<*rcv_wscale)) {
-               int init_cwnd = 4;
-               if (mss > 1460*3)
+               int init_cwnd;
+
+               if (mss > 1460)
                        init_cwnd = 2;
-               else if (mss > 1460)
-                       init_cwnd = 3;
+               else
+                       init_cwnd = (mss > 1095) ? 3 : 4;
                if (*rcv_wnd > init_cwnd*mss)
                        *rcv_wnd = init_cwnd*mss;
        }
@@ -509,7 +510,16 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
                        tp->lost_out -= diff;
                        tp->left_out -= diff;
                }
+
                if (diff > 0) {
+                       /* Adjust Reno SACK estimate. */
+                       if (!tp->rx_opt.sack_ok) {
+                               tp->sacked_out -= diff;
+                               if ((int)tp->sacked_out < 0)
+                                       tp->sacked_out = 0;
+                               tcp_sync_left_out(tp);
+                       }
+
                        tp->fackets_out -= diff;
                        if ((int)tp->fackets_out < 0)
                                tp->fackets_out = 0;