From 80e96de5ba27312c22350337661cdb3e036c66d8 Mon Sep 17 00:00:00 2001 From: Victor Boivie Date: Wed, 15 Sep 2021 16:09:14 +0200 Subject: [PATCH] dcsctp: Add more consistency checks When there is no outstanding data, then next TSN to allocate should always be one more than what the client has last ACKed. Bug: None Change-Id: Ieb8b5b23912d77d96fe3749fb53fd53652d97066 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232002 Commit-Queue: Victor Boivie Reviewed-by: Florent Castelli Cr-Commit-Position: refs/heads/main@{#35016} --- net/dcsctp/tx/retransmission_queue.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/dcsctp/tx/retransmission_queue.cc b/net/dcsctp/tx/retransmission_queue.cc index 84681433bc..b1b9afbf8c 100644 --- a/net/dcsctp/tx/retransmission_queue.cc +++ b/net/dcsctp/tx/retransmission_queue.cc @@ -108,6 +108,11 @@ bool RetransmissionQueue::IsConsistent() const { } } + if (outstanding_data_.empty() && + next_tsn_ != last_cumulative_tsn_ack_.next_value()) { + return false; + } + return actual_outstanding_bytes == outstanding_bytes_ && actual_outstanding_items == outstanding_items_ && actual_to_be_retransmitted == to_be_retransmitted_;