remote control: fall back to IPv4 when IPv6 bind fails#1832
Draft
Narasimha-sc wants to merge 1 commit into
Draft
remote control: fall back to IPv4 when IPv6 bind fails#1832Narasimha-sc wants to merge 1 commit into
Narasimha-sc wants to merge 1 commit into
Conversation
The remote-host TLS listener binds via startTCPServer with host=Nothing, which prefers the IPv6 wildcard (::). The invitation sent to the mobile device only ever advertises an IPv4 address, so when IPv6 is disabled the bind to :: throws and the desktop app cannot be reached (issue #5515). Keep the existing IPv6-preferring bind and only fall back to binding 0.0.0.0 when it fails, so behaviour is unchanged whenever IPv6 is available and the SMP server transport path is not touched.
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.
Connecting a mobile to the desktop fails when IPv6 is disabled (simplex-chat/simplex-chat#5515). The remote-host listener binds via
startTCPServer … Nothing, which prefers the IPv6 wildcard (::), yet the invitation only advertises an IPv4 address — so when IPv6 is disabled thebindto::throws and the desktop is unreachable.This keeps the IPv6-preferring bind and only falls back to
0.0.0.0when it throws.Blast radius: confined to
startTLSServer(remote-control path) — the sharedstartTCPServerand the SMP-server transport are untouched. When IPv6 is available the primary bind succeeds and the fallback never runs, so the working path is unchanged.catchAnycatches only synchronous exceptions, so an async cancellation during bind still propagates.