diff options
Diffstat (limited to 'net/netns/netns_darwin.go')
| -rw-r--r-- | net/netns/netns_darwin.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/netns/netns_darwin.go b/net/netns/netns_darwin.go index ac5e89d76..794b9b864 100644 --- a/net/netns/netns_darwin.go +++ b/net/netns/netns_darwin.go @@ -21,6 +21,7 @@ import ( "tailscale.com/net/netmon" "tailscale.com/net/tsaddr" "tailscale.com/types/logger" + "tailscale.com/version" ) func control(logf logger.Logf, netMon *netmon.Monitor) func(network, address string, c syscall.RawConn) error { @@ -38,8 +39,9 @@ var errInterfaceStateInvalid = errors.New("interface state invalid") // It's intentionally the same signature as net.Dialer.Control // and net.ListenConfig.Control. func controlLogf(logf logger.Logf, netMon *netmon.Monitor, network, address string, c syscall.RawConn) error { - if isLocalhost(address) { - // Don't bind to an interface for localhost connections. + // Don't bind to an interface for localhost connections for tailscaled. We must still bind for + // the network extension variants. + if version.IsMacOSTailscaled() && isLocalhost(address) { return nil } |
