From 17dd53f1e0844745bfa284127e8f49cd7b89b426 Mon Sep 17 00:00:00 2001 From: ianswett Date: Wed, 28 Nov 2018 16:34:28 -0500 Subject: [PATCH 1/3] Prevent int underflow Fixes #2052 --- draft-ietf-quic-recovery.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 049237fa95..62b6e23498 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -848,8 +848,8 @@ Pseudocode for SetLossDetectionTimer follows: return if (loss_time != 0): // Early retransmit timer or time loss detection. - timeout = loss_time - - time_of_last_sent_retransmittable_packet + loss_detection_timer.set(loss_time) + return else: // RTO or TLP timer // Calculate RTO duration From bd5e1f2e4333c3fe652d6897c6be037632de90dc Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 4 Dec 2018 18:15:26 -0500 Subject: [PATCH 2/3] Update draft-ietf-quic-recovery.md Remove else --- draft-ietf-quic-recovery.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 62b6e23498..8d8d92cb1a 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -850,18 +850,18 @@ Pseudocode for SetLossDetectionTimer follows: // Early retransmit timer or time loss detection. loss_detection_timer.set(loss_time) return - else: - // RTO or TLP timer - // Calculate RTO duration - timeout = - smoothed_rtt + 4 * rttvar + max_ack_delay - timeout = max(timeout, kMinRTOTimeout) - timeout = timeout * (2 ^ rto_count) - if (tlp_count < kMaxTLPs): - // Tail Loss Probe - tlp_timeout = max(1.5 * smoothed_rtt - + max_ack_delay, kMinTLPTimeout) - timeout = min(tlp_timeout, timeout) + + // RTO or TLP timer + // Calculate RTO duration + timeout = + smoothed_rtt + 4 * rttvar + max_ack_delay + timeout = max(timeout, kMinRTOTimeout) + timeout = timeout * (2 ^ rto_count) + if (tlp_count < kMaxTLPs): + // Tail Loss Probe + tlp_timeout = max(1.5 * smoothed_rtt + + max_ack_delay, kMinTLPTimeout) + timeout = min(tlp_timeout, timeout) loss_detection_timer.set( time_of_last_sent_retransmittable_packet + timeout) From 19466daa392a76fb06787aeccd39843f26752527 Mon Sep 17 00:00:00 2001 From: ianswett Date: Tue, 4 Dec 2018 18:19:58 -0500 Subject: [PATCH 3/3] Update draft-ietf-quic-recovery.md --- draft-ietf-quic-recovery.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ietf-quic-recovery.md b/draft-ietf-quic-recovery.md index 8d8d92cb1a..16df1d2b35 100644 --- a/draft-ietf-quic-recovery.md +++ b/draft-ietf-quic-recovery.md @@ -850,7 +850,7 @@ Pseudocode for SetLossDetectionTimer follows: // Early retransmit timer or time loss detection. loss_detection_timer.set(loss_time) return - + // RTO or TLP timer // Calculate RTO duration timeout =