mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-10 05:10:26 +00:00
Reuse GUID so Windows no longer keeps creating new networks each time Yggdrasil starts
This commit is contained in:
parent
baebaabc43
commit
0529910b01
@ -24,8 +24,13 @@ func (tun *TunAdapter) setup(ifname string, addr string, mtu int) error {
|
||||
ifname = defaults.GetDefaults().DefaultIfName
|
||||
}
|
||||
var err error
|
||||
var iface wgtun.Device
|
||||
err = doAsSystem(func() {
|
||||
iface, err := wgtun.CreateTUN(ifname, mtu)
|
||||
if guid, gerr := windows.GUIDFromString("{8f59971a-7872-4aa6-b2eb-061fc4e9d0a7}"); gerr == nil {
|
||||
iface, err = wgtun.CreateTUNWithRequestedGUID(ifname, &guid, mtu)
|
||||
} else {
|
||||
panic(gerr)
|
||||
}
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user