mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-23 18:15:24 +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
|
ifname = defaults.GetDefaults().DefaultIfName
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
|
var iface wgtun.Device
|
||||||
err = doAsSystem(func() {
|
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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user