From e381808704460f093c456487f77a57ab2ee015de Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 9 May 2018 16:42:24 +0100 Subject: [PATCH] Add ability to select interface by friendly name on Windows --- src/yggdrasil/tun_windows.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/yggdrasil/tun_windows.go b/src/yggdrasil/tun_windows.go index bfd55794..d4a15f93 100644 --- a/src/yggdrasil/tun_windows.go +++ b/src/yggdrasil/tun_windows.go @@ -23,6 +23,11 @@ func (tun *tunDevice) setup(ifname string, iftapmode bool, addr string, mtu int) config := water.Config{DeviceType: water.TAP} config.PlatformSpecificParams.ComponentID = "tap0901" config.PlatformSpecificParams.Network = "169.254.0.1/32" + if ifname == "auto" { + config.PlatformSpecificParams.InterfaceName = "" + } else { + config.PlatformSpecificParams.InterfaceName = ifname + } iface, err := water.New(config) if err != nil { panic(err)