From: Gavin McCullagh Date: Thu, 26 Oct 2006 06:05:52 +0000 (-0700) Subject: [TCP] H-TCP: fix integer overflow X-Git-Tag: v2.6.19-rc4~76^2~1 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=2a272f98619f188efe22119b0415aac6bc34a13f;p=powerpc.git [TCP] H-TCP: fix integer overflow When using H-TCP with a single flow on a 500Mbit connection (or less actually), alpha can exceed 65000, so alpha needs to be a u32. Signed-off-by: Gavin McCullagh Signed-off-by: Doug Leith Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c index 682e7d5b6f..283be3cb46 100644 --- a/net/ipv4/tcp_htcp.c +++ b/net/ipv4/tcp_htcp.c @@ -23,7 +23,7 @@ module_param(use_bandwidth_switch, int, 0644); MODULE_PARM_DESC(use_bandwidth_switch, "turn on/off bandwidth switcher"); struct htcp { - u16 alpha; /* Fixed point arith, << 7 */ + u32 alpha; /* Fixed point arith, << 7 */ u8 beta; /* Fixed point arith, << 7 */ u8 modeswitch; /* Delay modeswitch until we had at least one congestion event */ u32 last_cong; /* Time since last congestion event end */