Repository navigation
cid: don't fail when re-queuing an already queued DCID retirement - #2919
Open
xhon-pelushi wants to merge 1 commit into
Open
xhon-pelushi wants to merge 1 commit into
xhon-pelushi wants to merge 1 commit into
Conversation
BoundedConnectionIdSeqSet::insert() checked the capacity before looking at whether the sequence number was already in the set, so queuing a RETIRE_CONNECTION_ID for a sequence that is already pending returned IdLimit once the set was full, and that error closes the connection (e.g. from the lost-frame path in send_single()). Inserting an existing element doesn't grow the set, so return early in that case. Fixes cloudflare#2906.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2906.
BoundedConnectionIdSeqSet::insert()checks the capacity before checking whether the sequence number is already in the set. So once the retired DCID set is full, queuing a RETIRE_CONNECTION_ID for a sequence number that is already pending returnsIdLimit, and from the lost-frame path insend_single()that error closes the connection. The seq is normally removed from the set when the frame is sent, so this needs the same seq to be queued again in the meantime (for example by a retransmitted NEW_CONNECTION_ID below the current Retire Prior To) while the set is at capacity.Inserting an existing element doesn't grow the set, so
insert()now returns early in that case. New sequence numbers still hit the limit as before.Added
cid::tests::retire_dcid_seq_already_queued_when_full, which fails on master withErr(IdLimit)and passes with the change.Tested with
cargo test -p quiche --lib(1283 passed).