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
import (
"errors"
"fmt"
+ "os"
"os/exec"
"sort"
+ "strconv"
"strings"
"syscall"
"time"
versionKey = `SOFTWARE\Microsoft\Windows NT\CurrentVersion`
)
+var configureWSL, _ = strconv.ParseBool(os.Getenv("TS_DEBUG_CONFIGURE_WSL"))
+
type windowsManager struct {
logf logger.Logf
guid string
@@ -307,6 +311,7 @@ func (m windowsManager) SetDNS(cfg OSConfig) error {
// On initial setup of WSL, the restart caused by --shutdown is slow,
// so we do it out-of-line.
+ if configureWSL {
go func() {
if err := m.wslManager.SetDNS(cfg); err != nil {
m.logf("WSL SetDNS: %v", err) // continue
@@ -314,6 +319,7 @@ func (m windowsManager) SetDNS(cfg OSConfig) error {
m.logf("WSL SetDNS: success")
}
}()
+ }
return nil
}
