From 0529910b01015332b0568342f82830baf52fe158 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 23 Nov 2019 13:34:27 +0000 Subject: [PATCH] Reuse GUID so Windows no longer keeps creating new networks each time Yggdrasil starts --- src/tuntap/tun_windows.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tuntap/tun_windows.go b/src/tuntap/tun_windows.go index 7cedfc8..73ab398 100644 --- a/src/tuntap/tun_windows.go +++ b/src/tuntap/tun_windows.go @@ -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) }