aboutsummaryrefslogtreecommitdiffstats
path: root/send.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-20 06:50:07 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-20 06:50:07 +0200
commitacb5481246ea97bff64cc3eba1fa4255fc1ccd72 (patch)
treecab32a55aac483eb25e5a8c944d14e10f4610cd3 /send.go
parentFix race with closing event channel (diff)
downloadwireguard-go-acb5481246ea97bff64cc3eba1fa4255fc1ccd72.tar.xz
wireguard-go-acb5481246ea97bff64cc3eba1fa4255fc1ccd72.zip
Fix data races in timers
Diffstat (limited to 'send.go')
-rw-r--r--send.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/send.go b/send.go
index d57e11b..299274d 100644
--- a/send.go
+++ b/send.go
@@ -124,7 +124,7 @@ func (peer *Peer) SendKeepalive() bool {
func (peer *Peer) SendHandshakeInitiation(isRetry bool) error {
if !isRetry {
- peer.timers.handshakeAttempts = 0
+ atomic.StoreUint32(&peer.timers.handshakeAttempts, 0)
}
peer.handshake.mutex.RLock()