summaryrefslogtreecommitdiffhomepage
path: root/device/peer.go
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@tailscale.com>2019-11-07 11:13:05 -0500
committerJason A. Donenfeld <Jason@zx2c4.com>2020-05-02 01:46:42 -0600
commit203554620dc8114de1ff70bb30b80f828e9e26ad (patch)
tree49f36961f2090dc07d15cad3204a1a3531dc233d /device/peer.go
parent6aefb61355c9da539383dd0c2bc5f2bb3dbb3963 (diff)
conn: introduce new package that splits out the Bind and Endpoint types
The sticky socket code stays in the device package for now, as it reaches deeply into the peer list. This is the first step in an effort to split some code out of the very busy device package. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
Diffstat (limited to 'device/peer.go')
-rw-r--r--device/peer.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/device/peer.go b/device/peer.go
index 19434cd..79d4981 100644
--- a/device/peer.go
+++ b/device/peer.go
@@ -12,6 +12,8 @@ import (
"sync"
"sync/atomic"
"time"
+
+ "golang.zx2c4.com/wireguard/conn"
)
const (
@@ -24,7 +26,7 @@ type Peer struct {
keypairs Keypairs
handshake Handshake
device *Device
- endpoint Endpoint
+ endpoint conn.Endpoint
persistentKeepaliveInterval uint16
// These fields are accessed with atomic operations, which must be
@@ -290,7 +292,7 @@ func (peer *Peer) Stop() {
var RoamingDisabled bool
-func (peer *Peer) SetEndpointFromPacket(endpoint Endpoint) {
+func (peer *Peer) SetEndpointFromPacket(endpoint conn.Endpoint) {
if RoamingDisabled {
return
}