Repository navigation
Conversation
Saved peer paths can delay traffic for several minutes after a network change. Check quiet paths and use an available relay when replies stop. Reuse ordinary heartbeats and limit faster recovery to normal mode. Retry unanswered checks with HELLO to support peers that ignore ECHO. Skip redundant checks for bonded peers.
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.
Note
This pull request was prepared using AI. I've reviewed the patch and tried to keep it clean, but I admit the ZeroTier codebase is outside my expertise.
After a network change, ZeroTier can keep sending to a peer's old address for about four minutes, even while a root relay is reachable. I reproduced this when moving a laptop from a shared Wi-Fi network to a hotspot. This change reduced the reconnection time for my SSH sessions down to ~30-40s.
This change gives ordinary heartbeats time to confirm a connection before sending extra checks. If a check goes unanswered for one heartbeat interval, traffic uses another recently active direct path or an available relay. Retries use HELLO because peers may ignore ECHO. Valid direct traffic makes the path usable again.
Low-bandwidth mode uses the existing recovery behavior. Bonded connections use their own recovery.
Tradeoffs
Tests
One regression checks direct delivery, recovery through a relay after path loss, and return to direct delivery. It fails on unpatched upstream code.