aboutsummaryrefslogtreecommitdiffstats
path: root/tun/tun_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-04-11 19:34:43 +0200
committerSimon Rozman <simon@rozman.si>2019-04-11 19:38:11 +0200
commitef5f3ad80a43f48e037e9b665f2a3f3405396569 (patch)
tree430cacd2bb1a2b717aafc77fffc02b85a8c4bfab /tun/tun_windows.go
parenttun: windows: do not sleep after OPERATION_ABORTED on write (diff)
downloadwireguard-go-ef5f3ad80a43f48e037e9b665f2a3f3405396569.tar.xz
wireguard-go-ef5f3ad80a43f48e037e9b665f2a3f3405396569.zip
tun: windows: Adopt new error codes returned by Wintun
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'tun/tun_windows.go')
-rw-r--r--tun/tun_windows.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index e55fa6f..2fa6901 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -9,7 +9,6 @@ import (
"errors"
"os"
"sync"
- "syscall"
"time"
"unsafe"
@@ -273,7 +272,7 @@ func (tun *NativeTun) Read(buff []byte, offset int) (int, error) {
retries--
continue
}
- if ok && pe.Err == syscall.Errno(6) /*windows.ERROR_INVALID_HANDLE*/ {
+ if ok && pe.Err == windows.ERROR_HANDLE_EOF {
tun.closeTUN()
break
}
@@ -315,7 +314,7 @@ func (tun *NativeTun) Flush() error {
retries--
continue
}
- if ok && pe.Err == syscall.Errno(6) /*windows.ERROR_INVALID_HANDLE*/ {
+ if ok && pe.Err == windows.ERROR_HANDLE_EOF {
tun.closeTUN()
break
}