summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-11-16 21:07:15 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-11-16 21:07:31 +0100
commitfc4f975a4de1917df9d0fe2aaf0e009428546fe2 (patch)
tree927662aebf7f950d019e601efc4b0abb3b5a0fdb
parentdevice: start peers before running handshake test (diff)
downloadwireguard-go-fc4f975a4de1917df9d0fe2aaf0e009428546fe2.tar.xz
wireguard-go-fc4f975a4de1917df9d0fe2aaf0e009428546fe2.zip
device: align 64-bit atomic member in Device
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--device/device.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/device/device.go b/device/device.go
index 91654c6..3625608 100644
--- a/device/device.go
+++ b/device/device.go
@@ -53,16 +53,17 @@ type Device struct {
publicKey NoisePublicKey
}
- rate struct {
- underLoadUntil int64
- limiter ratelimiter.Ratelimiter
- }
-
peers struct {
sync.RWMutex // protects keyMap
keyMap map[NoisePublicKey]*Peer
}
+ // Keep this 8-byte aligned
+ rate struct {
+ underLoadUntil int64
+ limiter ratelimiter.Ratelimiter
+ }
+
allowedips AllowedIPs
indexTable IndexTable
cookieChecker CookieChecker