mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-27 19:43:01 +00:00
wgengine: return explicit lo0 for loopback addrs on sandboxed macOS
fixes tailscale/tailscale#TODO The source address link selection on sandboxed macOS doesn't deal with loopback addresses correctly. This adds an explicit check to ensure we return the loopback interface for loopback addresses instead of the default empty interface. Specifcially, this allows the dns resolver to route queries to a loopback IP which is a common tactic for local DNS proxies.
This commit is contained in:
parent
156cd53e77
commit
82ca894ff5
@ -1580,6 +1580,11 @@ type fwdDNSLinkSelector struct {
|
||||
}
|
||||
|
||||
func (ls fwdDNSLinkSelector) PickLink(ip netip.Addr) (linkName string) {
|
||||
// sandboxed macOS needs some extra hand-holding for loopback addresses.
|
||||
if ip.IsLoopback() && version.IsSandboxedMacOS() {
|
||||
return "lo0"
|
||||
}
|
||||
|
||||
if ls.ue.isDNSIPOverTailscale.Load()(ip) {
|
||||
return ls.tunName
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user