wireguard-go/tun
Jason A. Donenfeld 097af6e135 tun: windows: protect reads from closing
The code previously used the old errors channel for checking, rather
than the simpler boolean, which caused issues on shutdown, since the
errors channel was meaningless. However, looking at this exposed a more
basic problem: Close() and all the other functions that check the closed
boolean can race. So protect with a basic RW lock, to ensure that
Close() waits for all pending operations to complete.

Reported-by: Joshua Sjoding <joshua.sjoding@scjalliance.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-04-26 22:22:45 -04:00
..
netstack tun/netstack: bump deps and api 2021-03-06 08:48:14 -07:00
tuntest global: remove TODO name graffiti 2021-02-23 20:00:57 +01:00
wintun memmod: use resource functions from x/sys 2021-03-08 21:04:09 -07:00
operateonfd.go global: bump copyright 2021-01-28 17:52:15 +01:00
tun.go global: bump copyright 2021-01-28 17:52:15 +01:00
tun_darwin.go tun: make NativeTun.Close well behaved, not crash on double close 2021-02-22 15:26:29 +01:00
tun_freebsd.go tun: freebsd: avoid OOB writes 2021-04-19 15:10:23 -06:00
tun_linux.go tun: linux: do not spam events every second from hack listener 2021-03-11 09:23:11 -07:00
tun_openbsd.go tun: make NativeTun.Close well behaved, not crash on double close 2021-02-22 15:26:29 +01:00
tun_windows.go tun: windows: protect reads from closing 2021-04-26 22:22:45 -04:00