Skip to content

Guard both sides of LAN fast-open races - #278

Open
marcus-pousette-hp wants to merge 1 commit into
mainfrom
fix/unmatched-lan-fast-open
Open

Guard both sides of LAN fast-open races#278
marcus-pousette-hp wants to merge 1 commit into
mainfrom
fix/unmatched-lan-fast-open

Conversation

@marcus-pousette-hp

@marcus-pousette-hp marcus-pousette-hp commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This prevents an initiator from claiming a direct route before the responder has committed to it.

Changes

  • When a LAN attempt starts, skip the speculative initial fast-open probe while the LAN ping and coordinated holepunching continue concurrently.
  • On the responder, echo holepunch probes only after local coordinated punching has started. This deliberately checks local punching, rather than the initiator's advertised intent.

Probe ordering

For an older initiator connecting to an updated responder:

Probe arrival Responder behavior
Before any control message Ignore
After the initial punching: false message Ignore
After punching: true, but before local approval and p.punch() Ignore
After local p.punch() starts Echo

This covers both probe-before-control and control-before-probe ordering. A delayed probe cannot bypass NAT analysis, application rejection, punch rate limits, or an abort. Once local punching has started, the responder has committed and echoing is safe.

There is no wire-format change, and intentional non-LAN server fast-open remains available. Updated responders protect older initiators regardless of probe ordering; older responders retain the existing behavior outside detected LAN attempts until upgraded.

Validation

  • Permanent tests cover matched and fallback LAN candidates, preservation of intentional non-LAN server fast-open, and responder echo behavior before and after local punching.
  • Full Node, Bare, and integration suites pass.
  • Version-pinned mixed-version evidence against hyperdht@6.33.1, including reordered-probe acceptance and rejection, is isolated in draft #288.

Co-authored with AI

@marcus-pousette-hp
marcus-pousette-hp requested a review from a team August 3, 2026 12:52
@marcus-pousette-hp marcus-pousette-hp changed the title Disable fast-open for unmatched LAN candidates Disable initial fast-open during LAN races Aug 4, 2026
@marcus-pousette-hp
marcus-pousette-hp force-pushed the fix/unmatched-lan-fast-open branch 3 times, most recently from f4f6710 to edac678 Compare August 14, 2026 20:11
@marcus-pousette-hp marcus-pousette-hp changed the title Disable initial fast-open during LAN races Guard both sides of LAN fast-open races Aug 14, 2026
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.

1 participant