fix: self-heal one-sided registrations across IP changes - #94
Merged
Conversation
Polling is driven by registered records, so a Mac whose user never registered its peer dials nothing — and an IP change on that side never reaches the peer's registered record; without Bonjour the peer keeps dialing the old address until a manual re-add. When nothing is registered, introduce to discovered peers that have proved the current pairing key on the same 30s cadence. The receiver's source-IP ingest heals its registered record, and the reply refreshes this side's discovered entry so it survives the TTL. Self-addresses are skipped (Bonjour discovers our own service), parked entries are skipped (no auth-fail spam), and the fingerprint gate means an impostor echoing our cleartext fp earns only a failed handshake. Remaining manual cases, both fundamental: both Macs changing IPs at once, and the half-configured Mac rebooting onto a new address (its discovered list is in-memory).
|
🎉 This PR is included in version 2.25.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Closes the one-sided gap in #92's endpoint healing.
Problem
INTRODUCE healing rides the reachability poll, and the poll is driven by registered records. A Mac whose user never registered its peer (the half-configured state during setup, or after a one-sided remove) dials nothing — so when its IP changes, nothing carries the new address to the peer, and without Bonjour the peer keeps dialing the dead address until a manual re-add.
Fix
When nothing is registered,
pollReachabilitynow also introduces to discovered peers that have proved the current pairing key, on the same 30s cadence. The receiving side's source-IP ingest heals its registered record exactly as in the mutual case, and the reply refreshes this side's discovered entry so it survives the introduce TTL — the loop is self-sustaining while both Macs are up.Guards:
networkDevices.isEmptygate) — their poll already exchanges both ways, so no extra traffic in the normal case.fpover Bonjour earns nothing but a failed handshake.Remaining manual cases (both fundamental)
Built clean with xcodebuild; swift-format clean.