mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-10 04:00:37 +00:00
Fix IfName 'auto' behaviour on Windows
This commit is contained in:
parent
f95ebeb821
commit
3a0870a448
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user