stream: harden data size handling

Handle edge cases around ACKs and last_ack getting below
'app_progress', which can happen during shutdown of a flow
with multiple GAPs.
pull/5533/head
Victor Julien 4 years ago
parent 5391746518
commit 4e925ca260

@ -1057,9 +1057,10 @@ static inline uint32_t AdjustToAcked(const Packet *p,
/* get max absolute offset */
last_ack_abs += delta;
}
DEBUG_VALIDATE_BUG_ON(app_progress > last_ack_abs);
/* see if the buffer contains unack'd data as well */
if (app_progress + data_len > last_ack_abs) {
if (app_progress <= last_ack_abs && app_progress + data_len > last_ack_abs) {
uint32_t check = data_len;
adjusted = last_ack_abs - app_progress;
BUG_ON(adjusted > check);

Loading…
Cancel
Save