]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/ipv4/tcp_output.c
tcp: consider recv buf for the initial window scale
[linux.git] / net / ipv4 / tcp_output.c
index b26aa870adc0001b7d5a1156f581afa0b3476965..bdaef7fd6e47701b2d2280e1f40f816e1920c432 100644 (file)
@@ -236,7 +236,8 @@ void tcp_select_initial_window(int __space, __u32 mss,
                /* Set window scaling on max possible window
                 * See RFC1323 for an explanation of the limit to 14
                 */
-               space = max_t(u32, sysctl_tcp_rmem[2], sysctl_rmem_max);
+               space = max_t(u32, space, sysctl_tcp_rmem[2]);
+               space = max_t(u32, space, sysctl_rmem_max);
                space = min_t(u32, space, *window_clamp);
                while (space > 65535 && (*rcv_wscale) < 14) {
                        space >>= 1;