wireguard-go/device
Dmytro Shynkevych 4369db522b device: wait for routines to stop before removing peers
Peers are currently removed after Device's goroutines are signaled to stop,
but without waiting for them to actually do so, which is racy.

For example, RoutineHandshake may be in Peer.SendKeepalive
when the corresponding peer is removed, which closes its nonce channel.
This causes a send on a closed channel, as observed in tailscale/tailscale#487.

This patch seems to be the correct synchronizing action:
Peer's goroutines are receivers and handle channel closure gracefully,
so Device's goroutines are the ones that should be fully stopped first.

Signed-Off-By: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-04 20:29:31 +10:00
..
allowedips.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
allowedips_rand_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
allowedips_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
bind_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
bindsocketshim.go device: export Bind and remove socketfd shims for android 2020-06-22 10:42:28 +10:00
constants.go replay: account for fqcodel reordering 2020-05-19 17:46:35 -06:00
cookie.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
cookie_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
device.go device: wait for routines to stop before removing peers 2020-07-04 20:29:31 +10:00
device_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
endpoint_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
indextable.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
ip.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
kdf_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
keypair.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
logger.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
misc.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
noise-helpers.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
noise-protocol.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
noise-types.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
noise_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
peer.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
peer_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
pools.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
queueconstants_android.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
queueconstants_default.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
queueconstants_ios.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
receive.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
send.go device: rework padding calculation and don't shadow paddedSize 2020-05-18 15:43:22 -06:00
sticky_default.go device: do not include sticky sockets on android 2020-06-07 01:50:20 -06:00
sticky_linux.go device: do not include sticky sockets on android 2020-06-07 01:50:20 -06:00
timers.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
tun.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
tun_test.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
uapi.go global: update header comments and modules 2020-05-02 02:08:26 -06:00
version.go version: bump snapshot 2020-03-20 12:00:53 -06:00