summaryrefslogtreecommitdiffhomepage
path: root/device/device.go
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 /device/device.go
parent9d699ba730bf1be7c9acc0b6a2cb80c3f92f939f (diff)
device: align 64-bit atomic member in Device
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/device.go')
-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