From 3a0870a448f0c1b43a4438a3b2ec9a92d4a4aec4 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 22 Nov 2019 20:11:39 +0000 Subject: [PATCH] Fix IfName 'auto' behaviour on Windows --- src/tuntap/tun_windows.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tuntap/tun_windows.go b/src/tuntap/tun_windows.go index 8b4f92cf..2afe2da6 100644 --- a/src/tuntap/tun_windows.go +++ b/src/tuntap/tun_windows.go @@ -9,6 +9,7 @@ import ( "strings" "unsafe" + "github.com/yggdrasil-network/yggdrasil-go/src/defaults" "golang.org/x/sys/windows" wgtun "golang.zx2c4.com/wireguard/tun" @@ -19,6 +20,9 @@ import ( // Configures the TUN adapter with the correct IPv6 address and MTU. func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error { + if ifname == "auto" { + ifname = defaults.GetDefaults().IfName + } var err error err = doAsSystem(func() { iface, err := wgtun.CreateTUN(ifname, mtu)