Skip to content

Commit a14d445

Browse files
committed
net/dns: make WSL network configuration opt-in for now
Tailscale seems to be breaking WSL configurations lately. Until we understand what changed, turn off Tailscale's involvement by default and make it opt-in. Updates tailscale#2815 Change-Id: I9977801f8debec7d489d97761f74000a4a33f71b Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> (cherry picked from commit 8df3fa4)
1 parent 1a4293c commit a14d445

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

net/dns/manager_windows.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ package dns
77
import (
88
"errors"
99
"fmt"
10+
"os"
1011
"os/exec"
1112
"sort"
13+
"strconv"
1214
"strings"
1315
"syscall"
1416
"time"
@@ -34,6 +36,8 @@ const (
3436
versionKey = `SOFTWARE\Microsoft\Windows NT\CurrentVersion`
3537
)
3638

39+
var configureWSL, _ = strconv.ParseBool(os.Getenv("TS_DEBUG_CONFIGURE_WSL"))
40+
3741
type windowsManager struct {
3842
logf logger.Logf
3943
guid string
@@ -307,13 +311,15 @@ func (m windowsManager) SetDNS(cfg OSConfig) error {
307311

308312
// On initial setup of WSL, the restart caused by --shutdown is slow,
309313
// so we do it out-of-line.
310-
go func() {
311-
if err := m.wslManager.SetDNS(cfg); err != nil {
312-
m.logf("WSL SetDNS: %v", err) // continue
313-
} else {
314-
m.logf("WSL SetDNS: success")
315-
}
316-
}()
314+
if configureWSL {
315+
go func() {
316+
if err := m.wslManager.SetDNS(cfg); err != nil {
317+
m.logf("WSL SetDNS: %v", err) // continue
318+
} else {
319+
m.logf("WSL SetDNS: success")
320+
}
321+
}()
322+
}
317323

318324
return nil
319325
}

0 commit comments

Comments
 (0)