mirror of
https://git.zx2c4.com/wireguard-go
synced 2025-10-22 16:19:25 +08:00
device: move stats fields back down and add test diagnostics
This reverts the movement of fields from d49f4e9
.
That commit was cherry-picked from another branch where a field
had changed and misaligned the atomic fields. After cherry-picking,
moving the fields was no longer necessary but got dragged along.
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
@@ -21,6 +21,14 @@ const (
|
||||
)
|
||||
|
||||
type Peer struct {
|
||||
// Mostly protects endpoint, but is generally taken whenever we modify peer
|
||||
sync.RWMutex
|
||||
keypairs Keypairs
|
||||
handshake Handshake
|
||||
device *Device
|
||||
endpoint conn.Endpoint
|
||||
persistentKeepaliveInterval uint16
|
||||
|
||||
// These fields are accessed with atomic operations, which must be
|
||||
// 64-bit aligned even on 32-bit platforms. Go guarantees that an
|
||||
// allocated struct will be 64-bit aligned. So we place
|
||||
@@ -35,14 +43,6 @@ type Peer struct {
|
||||
// bits. Don't place other atomic fields after this one.
|
||||
isRunning AtomicBool
|
||||
|
||||
// Mostly protects endpoint, but is generally taken whenever we modify peer
|
||||
sync.RWMutex
|
||||
keypairs Keypairs
|
||||
handshake Handshake
|
||||
device *Device
|
||||
endpoint conn.Endpoint
|
||||
persistentKeepaliveInterval uint16
|
||||
|
||||
timers struct {
|
||||
retransmitHandshake *Timer
|
||||
sendKeepalive *Timer
|
||||
|
Reference in New Issue
Block a user