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 { type KeyPair struct {
sendNonce uint64
send cipher.AEAD send cipher.AEAD
receive cipher.AEAD receive cipher.AEAD
replayFilter ReplayFilter replayFilter ReplayFilter
sendNonce uint64
isInitiator bool isInitiator bool
created time.Time created time.Time
localIndex uint32 localIndex uint32

View File

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