Repository navigation
Conversation
Magicsock reports every local interface address, including the addresses of a tailscaled tunnel interface, and onEngineStatus advertised them all to the peer. A peer on the same LAN could then pick our Tailscale address as the direct path, running WireGuard inside Tailscale's WireGuard through a 1280-byte-MTU tun. On Linux the batched (GSO) sends on that path mostly never arrive, so throughput from Linux collapsed to tens of KB/s (tailscale#168). Skip endpoints whose address is a Tailscale address (tsaddr.IsTailscaleIP) when advertising; the plain LAN address is used instead, and DERP remains the fallback where no direct path exists.
bradfitz
reviewed
Nov 18, 2026
| } | ||
| var eps []netip.AddrPort | ||
| for _, ep := range st.LocalAddrs { | ||
| if tsaddr.IsTailscaleIP(ep.Addr.Addr()) { |
Member
There was a problem hiding this comment.
We probably only want to do this conditionally on those 100.64.0.0/10 addresses actually being owned by a local Tailscale daemon/interface.
Plenty of other things in the world uses 100.64.0.0/10 that's not Tailscale.
This branch has not been deployed
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.
Direct paths through a peer's Tailscale address are slow to the point of unusable on Linux, and they are never better than the plain LAN address when both machines are on the same network.
What broke: magicsock reports every local interface address, including the tailscaled tunnel interface, and tailcat advertised them all to the peer. A peer on the same LAN could then pick our Tailscale address as the direct path, running WireGuard inside Tailscale's WireGuard through a 1280-byte-MTU tun. On Linux the batched (GSO) sends on that path mostly never arrive, so throughput from Linux fell to 12-18 KB/s while the other direction ran at 25 MB/s.
What changed: onEngineStatus now skips endpoints whose address is a Tailscale address (tsaddr.IsTailscaleIP). The plain LAN address is used instead, and DERP remains the fallback where no direct path exists.
Verified: new regression test TestOnEngineStatusFiltersTailscaleEndpoints, red to green. Without the fix it advertises all eight endpoints, with it only the five non-Tailscale ones. go vet and gofmt are clean. The kernel GSO/MTU behavior itself was not reproduced here; this is a unit-level check of endpoint selection.
One limit worth naming: this stops us advertising our Tailscale addresses. A peer can still learn our Tailscale address from the source of our pings, which is magicsock behavior upstream, so that direction is out of scope for this change.
Fixes #168