Skip to content

Offer a LAN address for pairing, not a VPN or bridge one - #11

Merged
guilyx merged 1 commit into
guilyx:mainfrom
animaartificialis:fix-lan-address-order
Oct 25, 2026
Merged

guilyx merged 1 commit into
guilyx:mainfrom
animaartificialis:fix-lan-address-order

Conversation

@animaartificialis

Copy link
Copy Markdown
Contributor

With a VPN connected and docker installed, motionless pair advertised the tunnel address as the one to open on the phone and listed the docker0 bridge 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 from ip addr in kernel order, where docker0 and tun0 carry scope global just 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 ip is unavailable or lists nothing, but no longer displaces a real LAN address.

Verified against a host with wlp0s20f3, docker0 and tun0 present: pairing now advertises the wlp0s20f3 address, and the phone connects over Wi-Fi.

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.

@guilyx guilyx left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@guilyx
guilyx merged commit 4543673 into guilyx:main Oct 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants