aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2005-09-28 16:31:48 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2005-09-28 16:31:48 -0700
commit6b251858d377196b8cea20e65cae60f584a42735 (patch)
tree4078d1d7fb50c25e222db5c54562da10ea4b4d5d /net/ipv4
parent64233bffbb50f12e576c61d1698a573c8033004a (diff)
[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>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_output.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index d6e3d269e90..caf2e2cff29 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -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;
}