]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
wintun: Add TUN device locking
authorSimon Rozman <simon@rozman.si>
Wed, 20 Feb 2019 12:12:08 +0000 (13:12 +0100)
committerSimon Rozman <simon@rozman.si>
Wed, 20 Feb 2019 12:12:08 +0000 (13:12 +0100)
commitb7025b56274f65080d3c20a34a35ec5a07422792
tree07b5848db7cf01fed1fd28307d6675619bebfff8
parent6581cfb8850ee98dc9ee7aceb76e51b0de904db1
wintun: Add TUN device locking

In case reading from TUN device detected TUN device was closed, it
closed the file handle and set tunFile to nil. The tunFile is
automatically reopened on retry, but... If another packet comes in the
WireGuard calls Write() method. With tunFile set to nil, this will
cause access violation.

Therefore, locking was introduced.

Signed-off-by: Simon Rozman <simon@rozman.si>
tun/tun_windows.go