diff options
author | David Crawshaw <crawshaw@tailscale.com> | 2019-11-07 11:13:05 -0500 |
---|---|---|
committer | David Crawshaw <david@zentus.com> | 2020-03-30 21:05:11 +1100 |
commit | c4a8eab3ddc37021433a4d08075a02b355aca21c (patch) | |
tree | 0f2355c17a7cc25c93b85142e5fa635ea487eac2 /device/peer.go | |
parent | 66793239d1fb15e6b3dfe5c7beaa68552d2f5bc5 (diff) | |
download | wireguard-go-c4a8eab3ddc37021433a4d08075a02b355aca21c.tar.gz wireguard-go-c4a8eab3ddc37021433a4d08075a02b355aca21c.zip |
conn: 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.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/device/peer.go b/device/peer.go index 65581d5..a96f261 100644 --- a/device/peer.go +++ b/device/peer.go @@ -12,6 +12,8 @@ import ( "sync" "sync/atomic" "time" + + "golang.zx2c4.com/wireguard/conn" ) const ( @@ -38,7 +40,7 @@ type Peer struct { keypairs Keypairs handshake Handshake device *Device - endpoint Endpoint + endpoint conn.Endpoint persistentKeepaliveInterval uint16 timers struct { @@ -293,7 +295,7 @@ func (peer *Peer) Stop() { var RoamingDisabled bool -func (peer *Peer) SetEndpointFromPacket(endpoint Endpoint) { +func (peer *Peer) SetEndpointFromPacket(endpoint conn.Endpoint) { if RoamingDisabled { return } |