Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a272f98 authored by Gavin McCullagh's avatar Gavin McCullagh Committed by David S. Miller
Browse files

[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: default avatarGavin McCullagh <gavin.mccullagh@nuim.ie>
Signed-off-by: default avatarDoug Leith <doug.leith@nuim.ie>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 22119240
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -23,7 +23,7 @@ module_param(use_bandwidth_switch, int, 0644);
MODULE_PARM_DESC(use_bandwidth_switch, "turn on/off bandwidth switcher");
MODULE_PARM_DESC(use_bandwidth_switch, "turn on/off bandwidth switcher");


struct htcp {
struct htcp {
	u16	alpha;		/* Fixed point arith, << 7 */
	u32	alpha;		/* Fixed point arith, << 7 */
	u8	beta;           /* Fixed point arith, << 7 */
	u8	beta;           /* Fixed point arith, << 7 */
	u8	modeswitch;     /* Delay modeswitch until we had at least one congestion event */
	u8	modeswitch;     /* Delay modeswitch until we had at least one congestion event */
	u32	last_cong;	/* Time since last congestion event end */
	u32	last_cong;	/* Time since last congestion event end */