Fix relay re-establishment for handshake on Disestablised entry - #1805
Merged
Conversation
…ed entry handleOutsideRelayPacket filled ViaSender.remoteIdx with relay.RemoteIndex, an index from the relay peer's index space, but the rescue in sendHandshakeResponse looks that value up in relayForByIdx, which is keyed by local index. The lookup could never hit, so a terminal relay entry left Disestablished by a one-sided teardown stayed Disestablished even after a valid handshake arrived over it. The responder's first transmit then failed to find an Established relay, deleted its only relay entry, and every subsequent send was silently dropped until dead-tunnel detection forced a re-handshake. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nbrownus
approved these changes
Jul 17, 2026
brad-defined
approved these changes
Jul 17, 2026
| via = ViaSender{ | ||
| UdpAddr: via.UdpAddr, | ||
| relayHI: hostinfo, | ||
| remoteIdx: relay.RemoteIndex, |
Collaborator
There was a problem hiding this comment.
yeah, this doesn't match the comment of the field in the struct. It was supposed to be the idx from the packet, not the relay's remote index.
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.
handleOutsideRelayPacketfilledViaSender.remoteIdxwithrelay.RemoteIndex,an index from the relay peer's index space, but the rescue in
sendHandshakeResponselooks that value up inrelayForByIdx, which is keyedby local index. The lookup could never hit, so a terminal relay entry left
Disestablishedby a one-sided teardown stayedDisestablishedeven after avalid handshake arrived over it. The responder's first transmit then failed
to find an
Establishedrelay, deleted its only relay entry, and everysubsequent send was silently dropped until dead-tunnel detection forced a
re-handshake.