Repository navigation
Offer a LAN address for pairing, not a VPN or bridge one - #11
Merged
Merged
Conversation
With a VPN connected and docker installed, pairing advertised the tunnel address as the one to type into the phone, and listed the docker0 bridge as the alternative — neither is reachable from a phone on the same Wi-Fi. primary_address() asks the routing table, and a VPN owns the default route, so it returns the tunnel address; the rest of the list came from 'ip addr' in kernel order, where docker0 and tun0 are 'scope global' like any real link. Rank candidates by interface kind instead: wireless and wired links first, unknown names next, container/VM bridges and VPN tunnels last. The routing table guess stays as a fallback for when 'ip' is unavailable or lists nothing, but no longer displaces a real LAN address.
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.
With a VPN connected and docker installed,
motionless pairadvertised the tunnel address as the one to open on the phone and listed thedocker0bridge as the alternative. Neither is reachable from a phone on the same Wi-Fi, and the Wi-Fi address was ranked last.primary_address()asks the routing table, and a VPN owns the default route, so it returns the tunnel address. The remaining candidates came fromip addrin kernel order, wheredocker0andtun0carryscope globaljust like a real link.Rank candidates by interface kind instead: wireless and wired links first, unknown names next, container/VM bridges and VPN tunnels last. The routing-table guess stays as a fallback for when
ipis unavailable or lists nothing, but no longer displaces a real LAN address.Verified against a host with
wlp0s20f3,docker0andtun0present: pairing now advertises thewlp0s20f3address, and the phone connects over Wi-Fi.