diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-20 06:50:07 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-20 06:50:07 +0200 |
commit | acb5481246ea97bff64cc3eba1fa4255fc1ccd72 (patch) | |
tree | cab32a55aac483eb25e5a8c944d14e10f4610cd3 /receive.go | |
parent | 18f43705ecbc8751bcf5ed05cd65cf93c36798b0 (diff) |
Fix data races in timers
Diffstat (limited to 'receive.go')
-rw-r--r-- | receive.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -105,12 +105,12 @@ func (device *Device) addToHandshakeQueue( * NOTE: Not thread safe, but called by sequential receiver! */ func (peer *Peer) keepKeyFreshReceiving() { - if peer.timers.sentLastMinuteHandshake { + if peer.timers.sentLastMinuteHandshake.Get() { return } keypair := peer.keypairs.Current() if keypair != nil && keypair.isInitiator && time.Now().Sub(keypair.created) > (RejectAfterTime-KeepaliveTimeout-RekeyTimeout) { - peer.timers.sentLastMinuteHandshake = true + peer.timers.sentLastMinuteHandshake.Set(true) peer.SendHandshakeInitiation(false) } } |