]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
wintun: don't run HrRenameConnection in separate thread
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 5 Jun 2019 11:09:00 +0000 (13:09 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 5 Jun 2019 11:09:20 +0000 (13:09 +0200)
It's very slow, but unfortunately we haven't a choice. NLA needs this to
have completed.

tun/wintun/wintun_windows.go

index 6daa4d70d60b017971dcb09ca8b2df378ecdebad..f962f6e070215faca11e584a9eb9fe6a26603de6 100644 (file)
@@ -528,11 +528,10 @@ func (wintun *Wintun) InterfaceName() (string, error) {
 //
 func (wintun *Wintun) SetInterfaceName(ifname string) error {
        // We have to tell the various runtime COM services about the new name too. We ignore the
-       // error because netshell isn't available on servercore. It's also slow, so we run it in a
-       // separate thread.
+       // error because netshell isn't available on servercore.
        // TODO: netsh.exe falls back to NciSetConnection in this case. If somebody complains, maybe
        // we should do the same.
-       go netshell.HrRenameConnection(&wintun.cfgInstanceID, windows.StringToUTF16Ptr(ifname))
+       netshell.HrRenameConnection(&wintun.cfgInstanceID, windows.StringToUTF16Ptr(ifname))
 
        // Set the interface name. The above line should have done this too, but in case it failed, we force it.
        key, err := registry.OpenKey(registry.LOCAL_MACHINE, wintun.netRegKeyName(), registry.SET_VALUE)