Repository navigation
fix(network-stack): challenge-ACK a SYN on an existing session - #158
Open
TadahiroYamamura wants to merge 1 commit into
Open
TadahiroYamamura wants to merge 1 commit into
TadahiroYamamura wants to merge 1 commit into
Conversation
A SYN matching an existing session got no reply, so a lingering session stalled the guest's connect() until its SYN retries ran out. Send a challenge ACK as RFC 9293 section 3.10.7.4 (RFC 5961) requires. A guest reconnecting with a new ISN answers it with RST, which removes the old session so its next SYN opens a new connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 6, 2026
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.
A3 of #155.
Problem
A SYN on the same 4-tuple as an existing session gets no reply, so when a session is left behind (A2, A4, etc.) the guest's
connect()hangs until its SYN retries run out.Fix
Following RFC 9293 §3.10.7.4 (RFC 5961), answer a SYN that hits an existing session with a challenge ACK and drop the segment. A guest reconnecting with a new ISN answers this unacceptable ACK with an RST, so the existing RST handling removes the old session and the next SYN retransmit opens a new connection.
Tests
A SYN with a new ISN on an existing session gets exactly one challenge ACK, and the session is neither replaced nor has its window overwritten. When the guest then sends an RST, the old session is removed and the next SYN opens a new connection.
Please check
Suggested CHANGELOG entry
Answer a guest SYN that matches an existing TCP session with a challenge ACK, so a stale session no longer blocks reconnecting on the same 4-tuple.
🤖 AI (Claude Code) was used for the investigation and for writing the code.
Contribution Agreement
Please ensure this PR follows the guidelines in
CONTRIBUTING.md.By submitting this pull request, I confirm the following:
I understand that the entity Earendil Inc. (incorporated in the state of Delaware in 2025) needs some rights from me in order to utilize my contributions in this PR. As a contributor I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Earendil Inc. can use, modify, copy, and redistribute my contributions, under Earendil Inc.'s choice of terms.