mirror of
https://git.zx2c4.com/wireguard-go
synced 2024-11-15 01:05:15 +01:00
wintun: Adjust tunRWQueue.left member to match Wintun driver
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
c4988999ac
commit
b13739ada2
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user