mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
BUG/MINOR: quic: underflow issue for bbr_inflight_hi_from_lost_packet()
Add a test to ensure that values of a local variable used by bbr_inflight_hi_from_lost_packet() is not be impacted by underflow issues when subtracting too big numbers and make this function return a correct value. Must be backported to 3.1.
This commit is contained in:
parent
22ab45a3a8
commit
ebfc301d5d
1 changed files with 4 additions and 0 deletions
|
|
@ -1334,9 +1334,13 @@ static uint64_t bbr_inflight_hi_from_lost_packet(struct quic_cc_rs *rs,
|
|||
BUG_ON(rs->lost < size);
|
||||
/* What was lost before this packet? */
|
||||
lost_prev = rs->lost - size;
|
||||
if (BBR_LOSS_THRESH_MULT * inflight_prev < lost_prev * BBR_LOSS_THRESH_DIVI)
|
||||
return inflight_prev;
|
||||
|
||||
lost_prefix =
|
||||
(BBR_LOSS_THRESH_MULT * inflight_prev - lost_prev * BBR_LOSS_THRESH_DIVI) /
|
||||
(BBR_LOSS_THRESH_DIVI - BBR_LOSS_THRESH_MULT);
|
||||
/* At what inflight value did losses cross BBRLossThresh? */
|
||||
return inflight_prev + lost_prefix;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue