Skip to content

Fix sequence number bounds check for RETIRE_CONNECTION_ID frames#37

Merged
glbrntt merged 1 commit into
apple:mainfrom
glbrntt:off-by-one
Jun 30, 2026
Merged

Fix sequence number bounds check for RETIRE_CONNECTION_ID frames#37
glbrntt merged 1 commit into
apple:mainfrom
glbrntt:off-by-one

Conversation

@glbrntt

@glbrntt glbrntt commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Per RFC 9000 §19.16, a RETIRE_CONNECTION_ID frame with a sequence number greater than any previously sent to the peer must be treated as a connection error.

However, the logic incorrectly included the largest previously seen sequence number as well leading to incorrect connection errors.

  • Replace guard with if so the condition matches the text.
  • Update the text as the RFC says "MUST" not "MAY"

Per RFC 9000 §19.16, a RETIRE_CONNECTION_ID frame with a sequence number
greater than any previously sent to the peer must be treated as a
connection error.

However, the logic incorrectly included the largest previously seen
sequence number as well leading to incorrect connection errors.

- Replace `guard` with `if` so the condition matches the text.
- Update the text as the RFC says "MUST" not "MAY"
@glbrntt glbrntt merged commit 5c291d9 into apple:main Jun 30, 2026
23 checks passed
@glbrntt glbrntt deleted the off-by-one branch June 30, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants