Repository navigation
fix(tailscale): support proxied UDP listeners - #3396
Open
selectarget wants to merge 1 commit into
Open
selectarget wants to merge 1 commit into
selectarget wants to merge 1 commit into
Conversation
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.
When a Tailscale outbound uses
dialer-proxy,tsnetrequests an unbound UDP listener such as:0. The listener currently passes an invalidnetip.AddrPort{}to the proxy dialer. With Mihomo DNS enabled, proxy adapters can try to resolve an empty destination and fail withcan't resolve ip: couldn't find ip, preventing Tailscale from starting.This change supplies a valid unspecified IPv4/IPv6 address and port zero when creating the proxied UDP association. Each subsequent
WriteTostill carries its real destination. A smallPacketConnwrapper converts proxy address wrappers into the IP/port addresses expected by Tailscale, preserving a usable local address when available.WriteTo, close, and deadline operations remain delegated to the original proxy connection. The listener path withoutdialer-proxyis unchanged.Validation:
go test -tags with_gvisor ./adapter/outbound -count=1 -timeout 180spassed on the currentAlphadevelopment branch.with_gvisor), a separate patched executable used a real Hysteria2 upstream bound to the physical network interface. STUN servers in Tokyo and Los Angeles observed that upstream's IPv4 egress.The real upstream has IPv4 connectivity only, so the successful manual test used IPv4 DNS resolution via DoH through that upstream. Remote IPv6 egress and other upstream proxy protocols have not been validated.
Fixes #3142.