mirror of
https://github.com/yggdrasil-network/water.git
synced 2025-05-19 16:35:10 +03:00
Fix Windows interface selection by name as changed in #59
This commit is contained in:
parent
8567d15277
commit
acc9cc2bfa
1 changed files with 4 additions and 2 deletions
|
@ -18,8 +18,10 @@ import (
|
||||||
// https://github.com/OpenVPN/openvpn
|
// https://github.com/OpenVPN/openvpn
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// tapDriverKey is a location of the TAP driver key.
|
// tapDriverKey is the location of the TAP driver key.
|
||||||
tapDriverKey = `SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}`
|
tapDriverKey = `SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}`
|
||||||
|
// netConfigKey is the location of the TAP adapter's network config.
|
||||||
|
netConfigKey = `SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}`
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -173,7 +175,7 @@ func getdeviceid(componentID string, interfaceName string) (deviceid string, err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if len(interfaceName) > 0 {
|
if len(interfaceName) > 0 {
|
||||||
key2 := fmt.Sprintf("%s\\%s\\Connection", tapDriverKey, val)
|
key2 := fmt.Sprintf("%s\\%s\\Connection", netConfigKey, val)
|
||||||
k2, err := registry.OpenKey(registry.LOCAL_MACHINE, key2, registry.READ)
|
k2, err := registry.OpenKey(registry.LOCAL_MACHINE, key2, registry.READ)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue