From eccc2ac6ee912842119561a4e0e840f5ac91af43 Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Sun, 7 Nov 2021 22:58:09 -0800 Subject: [PATCH] net/interfaces/windows: update Tailscale interface detection logic to account for new wintun naming. Signed-off-by: Maisem Ali --- net/interfaces/interfaces_windows.go | 8 ++++++-- tsconst/interface.go | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/net/interfaces/interfaces_windows.go b/net/interfaces/interfaces_windows.go index 96d7fcc16..3ca8033f0 100644 --- a/net/interfaces/interfaces_windows.go +++ b/net/interfaces/interfaces_windows.go @@ -116,8 +116,12 @@ func notTailscaleInterface(iface *winipcfg.IPAdapterAddresses) bool { // TODO(bradfitz): do this without the Description method's // utf16-to-string allocation. But at least we only do it for // the virtual interfaces, for which there won't be many. - return !(iface.IfType == winipcfg.IfTypePropVirtual && - iface.Description() == tsconst.WintunInterfaceDesc) + if iface.IfType != winipcfg.IfTypePropVirtual { + return true + } + desc := iface.Description() + return !(strings.Contains(desc, tsconst.WintunInterfaceDesc) || + strings.Contains(desc, tsconst.WintunInterfaceDesc0_14)) } // NonTailscaleInterfaces returns a map of interface LUID to interface diff --git a/tsconst/interface.go b/tsconst/interface.go index ae68e7355..f2f67a398 100644 --- a/tsconst/interface.go +++ b/tsconst/interface.go @@ -7,5 +7,6 @@ package tsconst // WintunInterfaceDesc is the description attached to Tailscale -// interfaces on Windows. This is set by our modified WinTun driver. +// interfaces on Windows. This is set by the WinTun driver. const WintunInterfaceDesc = "Tailscale Tunnel" +const WintunInterfaceDesc0_14 = "Wintun Userspace Tunnel"