Use simple 16-bit integer for persistent keepalive

Races for this aren't a huge problem.
This commit is contained in:
Jason A. Donenfeld
2018-04-18 07:24:33 +02:00
parent 099219be2a
commit eb6728400b
3 changed files with 8 additions and 11 deletions

View File

@@ -13,13 +13,14 @@ const (
)
type Peer struct {
persistentKeepaliveInterval uint64
isRunning AtomicBool
mutex sync.RWMutex
keyPairs KeyPairs
handshake Handshake
device *Device
endpoint Endpoint
persistentKeepaliveInterval uint16
_ uint32 // padding for alignment
stats struct {
txBytes uint64 // bytes send to peer (endpoint)