From 49a24122068dae94424eaad5cd3c03503c887dc6 Mon Sep 17 00:00:00 2001 From: Ethan <39577870+ethanndickson@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:08:57 +1100 Subject: [PATCH] fix(vpn): configure dns hosts with username (#16352) Previously we were configuring using the display name of the user, which may contain spaces, special characters, and isn't unique. This was always supposed to be the username. --- vpn/client.go | 2 +- vpn/tun_darwin.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vpn/client.go b/vpn/client.go index e2d846ca23..882197165e 100644 --- a/vpn/client.go +++ b/vpn/client.go @@ -148,7 +148,7 @@ func (*client) NewConn(initCtx context.Context, serverURL *url.URL, token string updatesCtrl := tailnet.NewTunnelAllWorkspaceUpdatesController( options.Logger, coordCtrl, - tailnet.WithDNS(conn, me.Name), + tailnet.WithDNS(conn, me.Username), tailnet.WithHandler(options.UpdateHandler), ) controller.WorkspaceUpdatesCtrl = updatesCtrl diff --git a/vpn/tun_darwin.go b/vpn/tun_darwin.go index 607be6c1ba..6251a550d6 100644 --- a/vpn/tun_darwin.go +++ b/vpn/tun_darwin.go @@ -5,10 +5,11 @@ package vpn import ( "os" - "cdr.dev/slog" "github.com/tailscale/wireguard-go/tun" "golang.org/x/sys/unix" "golang.org/x/xerrors" + + "cdr.dev/slog" ) func GetNetworkingStack(t *Tunnel, req *StartRequest, _ slog.Logger) (NetworkStack, error) {