From acb5481246ea97bff64cc3eba1fa4255fc1ccd72 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 20 May 2018 06:50:07 +0200 Subject: Fix data races in timers --- receive.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'receive.go') diff --git a/receive.go b/receive.go index 29fe5e9..56e65e7 100644 --- a/receive.go +++ b/receive.go @@ -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) } } -- cgit v1.2.3