Commit 6b251858 authored by David S. Miller's avatar David S. Miller

[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: default avatarDavid S. Miller <davem@davemloft.net>
parent 64233bff
...@@ -190,15 +190,16 @@ void tcp_select_initial_window(int __space, __u32 mss, ...@@ -190,15 +190,16 @@ void tcp_select_initial_window(int __space, __u32 mss,
} }
/* Set initial window to value enough for senders, /* 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. * will be satisfied with 2.
*/ */
if (mss > (1<<*rcv_wscale)) { if (mss > (1<<*rcv_wscale)) {
int init_cwnd = 4; int init_cwnd;
if (mss > 1460*3)
if (mss > 1460)
init_cwnd = 2; init_cwnd = 2;
else if (mss > 1460) else
init_cwnd = 3; init_cwnd = (mss > 1095) ? 3 : 4;
if (*rcv_wnd > init_cwnd*mss) if (*rcv_wnd > init_cwnd*mss)
*rcv_wnd = init_cwnd*mss; *rcv_wnd = init_cwnd*mss;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment