aboutsummaryrefslogtreecommitdiffstats
path: root/device/receive.go
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@tailscale.com>2019-11-07 11:13:05 -0500
committerDavid Crawshaw <crawshaw@tailscale.com>2019-12-08 20:28:38 -0500
commit82d6ac1f2d93eb9eb561fabf3e789387179a7c7d (patch)
tree80488aed7eff8e075aa935adb9e812fb7cbf29bb /device/receive.go
parentrwcancel: fix build on macOS (diff)
downloadwireguard-go-dc/branch.tar.xz
wireguard-go-dc/branch.zip
conn: new package that splits out the Bind and Endpoint typesdc/branch
The sticky socket code stays in the device package for now, as it reaches deeply into the peer list. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
Diffstat (limited to 'device/receive.go')
-rw-r--r--device/receive.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/device/receive.go b/device/receive.go
index 7d0693e..4818d64 100644
--- a/device/receive.go
+++ b/device/receive.go
@@ -17,12 +17,13 @@ import (
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
+ "golang.zx2c4.com/wireguard/conn"
)
type QueueHandshakeElement struct {
msgType uint32
packet []byte
- endpoint Endpoint
+ endpoint conn.Endpoint
buffer *[MaxMessageSize]byte
}
@@ -33,7 +34,7 @@ type QueueInboundElement struct {
packet []byte
counter uint64
keypair *Keypair
- endpoint Endpoint
+ endpoint conn.Endpoint
}
func (elem *QueueInboundElement) Drop() {
@@ -90,7 +91,7 @@ func (peer *Peer) keepKeyFreshReceiving() {
* Every time the bind is updated a new routine is started for
* IPv4 and IPv6 (separately)
*/
-func (device *Device) RoutineReceiveIncoming(IP int, bind Bind) {
+func (device *Device) RoutineReceiveIncoming(IP int, bind conn.Bind) {
logDebug := device.log.Debug
defer func() {
@@ -108,7 +109,7 @@ func (device *Device) RoutineReceiveIncoming(IP int, bind Bind) {
var (
err error
size int
- endpoint Endpoint
+ endpoint conn.Endpoint
)
for {