aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2020-04-10 12:47:00 +0200
committerSimon Rozman <simon@rozman.si>2020-04-10 13:15:58 +0200
commit4846b0a1b24123815869c4b6fe3c2412012c5673 (patch)
tree4f04c5376dfde059694ebd5c142323ad3b41451f
parentwintun: stop recreating and deleting TUN interface (diff)
downloadwireguard-go-sr/tunreuse.tar.xz
wireguard-go-sr/tunreuse.zip
Partially revert "wintun: quickly ignore non-Wintun devices"sr/tunreuse
This partially reverts commit c85e4a410f27986a2967a49c0155633c716bf3ca. The Pool method GetInterface() must return windows.ERROR_ALREADY_EXISTS if a foreign adapter with the given name was found. This prevents attachment to a non-Wintun interface. Signed-off-by: Simon Rozman <simon@rozman.si>
-rw-r--r--tun/wintun/wintun_windows.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/tun/wintun/wintun_windows.go b/tun/wintun/wintun_windows.go
index ca32e4f..77ae6d7 100644
--- a/tun/wintun/wintun_windows.go
+++ b/tun/wintun/wintun_windows.go
@@ -131,15 +131,6 @@ func (pool Pool) GetInterface(ifname string) (*Interface, error) {
continue
}
- // Check the Hardware ID to make sure it's a real Wintun device first. This avoids doing slow operations on non-Wintun devices.
- property, err := devInfo.DeviceRegistryProperty(devInfoData, setupapi.SPDRP_HARDWAREID)
- if err != nil {
- continue
- }
- if hwids, ok := property.([]string); ok && len(hwids) > 0 && hwids[0] != hardwareID {
- continue
- }
-
wintun, err := makeWintun(devInfo, devInfoData, pool)
if err != nil {
continue