]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
device: align 64-bit atomic member in Device
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 16 Nov 2021 20:07:15 +0000 (21:07 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 16 Nov 2021 20:07:31 +0000 (21:07 +0100)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
device/device.go

index 91654c6f5e3ffb0a5af532c4b5375c4ddf7db511..3625608db58e35ec083618c8281a37bf5b5182bb 100644 (file)
@@ -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