tcp_cubic: limit delayed_ack ratio to prevent divide error
commitb7daa2a2f4d09b288026b0c99f86677d513b976d
authorstephen hemminger <shemminger@vyatta.com>
Wed, 4 May 2011 10:04:56 +0000 (4 10:04 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 May 2014 05:54:28 +0000 (19 07:54 +0200)
tree65b57b1439ff0f003d2eb39ee36d2d3143dd1be7
parent18fbf564ddc8a54e5b22961cb50ece22b50cbfba
tcp_cubic: limit delayed_ack ratio to prevent divide error

TCP Cubic keeps a metric that estimates the amount of delayed
acknowledgements to use in adjusting the window. If an abnormally
large number of packets are acknowledged at once, then the update
could wrap and reach zero. This kind of ACK could only
happen when there was a large window and huge number of
ACK's were lost.

This patch limits the value of delayed ack ratio. The choice of 32
is just a conservative value since normally it should be range of
1 to 4 packets.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b9f47a3aaeabdce3b42829bbb27765fa340f76ba)
[wt: in 2.6.32, this fix is needed for the next one]
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/ipv4/tcp_cubic.c