Align 64-bit atomics

64-bit varibles that are accessed using the Go atomic functions must be
8-byte aligned on 32-bit platforms. Otherwise there are crashes.
This commit is contained in:
Jason A. Donenfeld 2018-04-18 06:54:21 +02:00
parent 6cecaf3157
commit 099219be2a
2 changed files with 2 additions and 2 deletions

View File

@ -14,10 +14,10 @@ import (
*/
type KeyPair struct {
sendNonce uint64
send cipher.AEAD
receive cipher.AEAD
replayFilter ReplayFilter
sendNonce uint64
isInitiator bool
created time.Time
localIndex uint32

View File

@ -13,9 +13,9 @@ const (
)
type Peer struct {
persistentKeepaliveInterval uint64
isRunning AtomicBool
mutex sync.RWMutex
persistentKeepaliveInterval uint64
keyPairs KeyPairs
handshake Handshake
device *Device