diff options
Diffstat (limited to 'device/peer.go')
-rw-r--r-- | device/peer.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/device/peer.go b/device/peer.go index a96f261..cb348d5 100644 --- a/device/peer.go +++ b/device/peer.go @@ -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 |