aboutsummaryrefslogtreecommitdiff
path: root/device/device.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2020-12-14 15:28:52 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-07 14:49:44 +0100
commit63066ce4062a85224821ce302e3eb8c34e95a658 (patch)
treef6945216e1b48bc5404f612cdcc5564b12e93aae /device/device.go
parente1fa1cc5560020e67d33aa7e74674853671cf0a0 (diff)
downloadwireguard-go-63066ce4062a85224821ce302e3eb8c34e95a658.tar.gz
wireguard-go-63066ce4062a85224821ce302e3eb8c34e95a658.zip
device: fix persistent_keepalive_interval data races
Co-authored-by: David Anderson <danderson@tailscale.com> Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
Diffstat (limited to 'device/device.go')
-rw-r--r--device/device.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/device/device.go b/device/device.go
index d9367e5..99f5e60 100644
--- a/device/device.go
+++ b/device/device.go
@@ -163,7 +163,7 @@ func deviceUpdateState(device *Device) {
device.peers.RLock()
for _, peer := range device.peers.keyMap {
peer.Start()
- if peer.persistentKeepaliveInterval > 0 {
+ if atomic.LoadUint32(&peer.persistentKeepaliveInterval) > 0 {
peer.SendKeepalive()
}
}