aboutsummaryrefslogtreecommitdiffstats
path: root/device/peer.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-12-22 21:34:21 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-07 14:49:44 +0100
commit25b01723ddc8bcd2993eb4b21e4e61164f55fa95 (patch)
tree083f2e5d6772d790996a1465e9cee28bbc1add99 /device/peer.go
parentdevice: add UAPI helper methods (diff)
downloadwireguard-go-25b01723ddc8bcd2993eb4b21e4e61164f55fa95.tar.xz
wireguard-go-25b01723ddc8bcd2993eb4b21e4e61164f55fa95.zip
device: fix alignment of peer stats member
This was shifted by 2 bytes when making persistent keepalive into a u32. Fix it by placing it after the aligned region. Fixes: e739ff7 ("device: fix persistent_keepalive_interval data races") Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/peer.go')
-rw-r--r--device/peer.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/device/peer.go b/device/peer.go
index 73e6083..8006b9f 100644
--- a/device/peer.go
+++ b/device/peer.go
@@ -28,7 +28,6 @@ type Peer struct {
device *Device
endpoint conn.Endpoint
persistentKeepaliveInterval uint32 // accessed atomically
- disableRoaming bool
// These fields are accessed with atomic operations, which must be
// 64-bit aligned even on 32-bit platforms. Go guarantees that an
@@ -41,6 +40,8 @@ type Peer struct {
lastHandshakeNano int64 // nano seconds since epoch
}
+ disableRoaming bool
+
timers struct {
retransmitHandshake *Timer
sendKeepalive *Timer