Skip to content
Commit b73c1849 authored by Andrew Baumann's avatar Andrew Baumann Committed by Jason Wang
Browse files

tap-win32: disable broken async write path



The code under the TUN_ASYNCHRONOUS_WRITES path makes two incorrect
assumptions about the behaviour of the WriteFile API for overlapped
file handles. First, WriteFile does not update the
lpNumberOfBytesWritten parameter when the write completes
asynchronously (the number of bytes written is known only when the
operation completes). Second, the buffer shouldn't be touched (or
freed) until the operation completes. This led to at least one bug
where tap_win32_write returned zero bytes written, which in turn
caused further writes ("receives") to be disabled for that device.

This change disables the asynchronous write path, while keeping most
of the code around in case someone sees value in resurrecting it. It
also adds some conditional debug output, similar to the read path.

Signed-off-by: default avatarAndrew Baumann <Andrew.Baumann@microsoft.com>
Acked-by: default avatarStefan Weil <sw@weilnetz.de>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
parent ee0428e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment