aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-02-16 21:05:25 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-02-16 21:05:25 +0100
commit4e439ea10e327d4894a5d2db2611e1fd03f54188 (patch)
tree58ab27d539f7cb5a44cdbd6430a6515f8557037f
parentversion: bump snapshot (diff)
downloadwireguard-go-4e439ea10e327d4894a5d2db2611e1fd03f54188.tar.xz
wireguard-go-4e439ea10e327d4894a5d2db2611e1fd03f54188.zip
conn: bump to 1.16 and get rid of NetErrClosed hack
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--conn/conn_linux.go8
-rw-r--r--conn/net_err_closed.go13
-rw-r--r--device/receive.go2
-rw-r--r--go.mod2
4 files changed, 6 insertions, 19 deletions
diff --git a/conn/conn_linux.go b/conn/conn_linux.go
index f07c3bb..58b7de1 100644
--- a/conn/conn_linux.go
+++ b/conn/conn_linux.go
@@ -213,7 +213,7 @@ func (bind *nativeBind) ReceiveIPv6(buff []byte) (int, Endpoint, error) {
var end NativeEndpoint
if bind.sock6 == -1 {
- return 0, nil, NetErrClosed
+ return 0, nil, net.ErrClosed
}
n, err := receive6(
bind.sock6,
@@ -229,7 +229,7 @@ func (bind *nativeBind) ReceiveIPv4(buff []byte) (int, Endpoint, error) {
var end NativeEndpoint
if bind.sock4 == -1 {
- return 0, nil, NetErrClosed
+ return 0, nil, net.ErrClosed
}
n, err := receive4(
bind.sock4,
@@ -246,12 +246,12 @@ func (bind *nativeBind) Send(buff []byte, end Endpoint) error {
nend := end.(*NativeEndpoint)
if !nend.isV6 {
if bind.sock4 == -1 {
- return NetErrClosed
+ return net.ErrClosed
}
return send4(bind.sock4, nend, buff)
} else {
if bind.sock6 == -1 {
- return NetErrClosed
+ return net.ErrClosed
}
return send6(bind.sock6, nend, buff)
}
diff --git a/conn/net_err_closed.go b/conn/net_err_closed.go
deleted file mode 100644
index 3530aaa..0000000
--- a/conn/net_err_closed.go
+++ /dev/null
@@ -1,13 +0,0 @@
-/* SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2017-2021 WireGuard LLC. All Rights Reserved.
- */
-
-package conn
-
-import _ "unsafe"
-
-//TODO: replace this with net.ErrClosed for Go 1.16
-
-//go:linkname NetErrClosed internal/poll.ErrNetClosing
-var NetErrClosed error
diff --git a/device/receive.go b/device/receive.go
index 6b9cccd..b1959c6 100644
--- a/device/receive.go
+++ b/device/receive.go
@@ -101,7 +101,7 @@ func (device *Device) RoutineReceiveIncoming(IP int, bind conn.Bind) {
if err != nil {
device.PutMessageBuffer(buffer)
- if errors.Is(err, conn.NetErrClosed) {
+ if errors.Is(err, net.ErrClosed) {
return
}
device.log.Errorf("Failed to receive packet: %v", err)
diff --git a/go.mod b/go.mod
index 79fff5a..11b6c7f 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module golang.zx2c4.com/wireguard
-go 1.15
+go 1.16
require (
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad