[TCP]: Fix init_cwnd calculations in tcp_select_initial_window()

Match it up to what RFC2414 really specifies.
Noticed by Rick Jones.

Signed-off-by: David S. Miller <davem@davemloft.net>

+6 -5
+6 -5
net/ipv4/tcp_output.c
··· 190 } 191 192 /* Set initial window to value enough for senders, 193 - * following RFC1414. Senders, not following this RFC, 194 * will be satisfied with 2. 195 */ 196 if (mss > (1<<*rcv_wscale)) { 197 - int init_cwnd = 4; 198 - if (mss > 1460*3) 199 init_cwnd = 2; 200 - else if (mss > 1460) 201 - init_cwnd = 3; 202 if (*rcv_wnd > init_cwnd*mss) 203 *rcv_wnd = init_cwnd*mss; 204 }
··· 190 } 191 192 /* Set initial window to value enough for senders, 193 + * following RFC2414. Senders, not following this RFC, 194 * will be satisfied with 2. 195 */ 196 if (mss > (1<<*rcv_wscale)) { 197 + int init_cwnd; 198 + 199 + if (mss > 1460) 200 init_cwnd = 2; 201 + else 202 + init_cwnd = (mss > 1095) ? 3 : 4; 203 if (*rcv_wnd > init_cwnd*mss) 204 *rcv_wnd = init_cwnd*mss; 205 }