Skip to content

Commit

Permalink
[TCP]: Fix init_cwnd calculations in tcp_select_initial_window()
Browse files Browse the repository at this point in the history
Match it up to what RFC2414 really specifies.
Noticed by Rick Jones.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 28, 2005
1 parent 64233bf commit 6b25185
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6b25185

Please sign in to comment.