summaryrefslogtreecommitdiffhomepage
path: root/tun
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-02-08 00:19:56 +0100
committerSimon Rozman <simon@rozman.si>2019-02-08 07:32:12 +0100
commitb13739ada2cfa1c66672e7a4edfe339e394b1a4f (patch)
tree60697319c0193234ab053f5d2266c5086e686792 /tun
parentc4988999ac073db9e08a4efdb2f82a3d4f32f25d (diff)
wintun: Adjust tunRWQueue.left member to match Wintun driver
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'tun')
-rw-r--r--tun/tun_windows.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go
index 5c231e7..f284baf 100644
--- a/tun/tun_windows.go
+++ b/tun/tun_windows.go
@@ -36,7 +36,7 @@ type tunPacket struct {
type tunRWQueue struct {
numPackets uint32
packets [TUN_MAX_PACKET_EXCHANGE]tunPacket
- left uint32
+ left bool
}
type nativeTun struct {
@@ -229,7 +229,7 @@ func (tun *nativeTun) Read(buff []byte, offset int) (int, error) {
}
}
- if tun.rdBuff.numPackets < TUN_MAX_PACKET_EXCHANGE || tun.rdBuff.left == 0 {
+ if tun.rdBuff.numPackets < TUN_MAX_PACKET_EXCHANGE || !tun.rdBuff.left {
// Buffer was not full. Wait for the interface data or user close.
r, err := windows.WaitForMultipleObjects(tun.signals[:], false, windows.INFINITE)
if err != nil {