Repository navigation
fix(lan): reach a peer at the address it names; log why an add fails - #259
Merged
Merged
Conversation
…ce; log why an add fails Adding someone failed at once with "Connection lost", in both directions, between a wired and a wireless machine on the same network, while discovery showed each to the other. A router that relays mDNS between its wired and wireless subnets forwards the announcement with its own address as the source. Peers were reached at that source, so both machines dialled the router, which has nothing on that port. - Each interface announces its own address in the TXT record (addr=). A receiver connects there when it is a valid private address, and falls back to the packet source for older versions. The private-only connect fence and the signed acknowledgements are unchanged, so a false addr gains nothing an attacker could not already do by spoofing the source. - Goodbyes go out per interface the same way. - Diagnostics, at info level: where each peer will be reached (named address and packet source), the error and address of a failed connection, a close before the code step, a reply with the wrong key, and every reason a holder turns a request away (not visible, busy, rate-limited, unreadable key, own key). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PJaGuL4V5ghYxXSGoyYU8n
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.
Reported: adding a PC failed at once with "Connection lost", in both directions, between a wired and a wireless machine on the same network. Discovery showed each machine to the other, and the Add dialog flashed for a moment before the error.
Likely cause: routers and mesh systems often put wired and wireless clients on separate subnets and relay mDNS between them. A relayed announcement arrives with the router's address as its source. DiffBro connected to the packet source, so both machines dialled the router and were refused straight away.
Fix:
addr=). A receiver connects there when it's a valid private address, and falls back to the source for older versions.addrgives an attacker nothing that spoofing the source didn't already.Diagnostics (info level, under Help ▸ Show log):
If the cause turns out to be something else, the next attempt's log will say what.
Verified:
npm run checkpasses.reachableAtand the diagnostics, each seen failing first.Both machines need this version for the named address to be sent.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PJaGuL4V5ghYxXSGoyYU8n