diff options
Diffstat (limited to 'tunnel/tools')
-rw-r--r-- | tunnel/tools/libwg-go/api-android.go | 12 | ||||
-rw-r--r-- | tunnel/tools/libwg-go/go.mod | 2 | ||||
-rw-r--r-- | tunnel/tools/libwg-go/go.sum | 4 | ||||
m--------- | tunnel/tools/wireguard-tools | 0 |
4 files changed, 13 insertions, 5 deletions
diff --git a/tunnel/tools/libwg-go/api-android.go b/tunnel/tools/libwg-go/api-android.go index aaca0b74..5fce4705 100644 --- a/tunnel/tools/libwg-go/api-android.go +++ b/tunnel/tools/libwg-go/api-android.go @@ -119,7 +119,13 @@ func wgTurnOn(interfaceName string, tunFd int32, settings string) int32 { } } - device.Up() + err = device.Up() + if err != nil { + logger.Errorf("Unable to bring up device: %v", err) + uapiFile.Close() + device.Close() + return -1 + } logger.Verbosef("Device started") var i int32 @@ -129,7 +135,9 @@ func wgTurnOn(interfaceName string, tunFd int32, settings string) int32 { } } if i == math.MaxInt32 { - unix.Close(int(tunFd)) + logger.Errorf("Unable to find empty handle") + uapiFile.Close() + device.Close() return -1 } tunnelHandles[i] = TunnelHandle{device: device, uapi: uapi} diff --git a/tunnel/tools/libwg-go/go.mod b/tunnel/tools/libwg-go/go.mod index 8fffa9a7..8422b2bc 100644 --- a/tunnel/tools/libwg-go/go.mod +++ b/tunnel/tools/libwg-go/go.mod @@ -5,5 +5,5 @@ go 1.15 require ( golang.org/x/net v0.0.0-20210119194325-5f4716e94777 // indirect golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c - golang.zx2c4.com/wireguard v0.0.20201119-0.20210126220548-d669c78c4306 + golang.zx2c4.com/wireguard v0.0.0-20210211144856-ef8115f63b22 ) diff --git a/tunnel/tools/libwg-go/go.sum b/tunnel/tools/libwg-go/go.sum index 3bcb54df..391f9d6f 100644 --- a/tunnel/tools/libwg-go/go.sum +++ b/tunnel/tools/libwg-go/go.sum @@ -18,5 +18,5 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.zx2c4.com/wireguard v0.0.20201119-0.20210126220548-d669c78c4306 h1:z7W9tlhU/KwkZWSX6QCfZXBcDpIa1JYANldQ/gFJj44= -golang.zx2c4.com/wireguard v0.0.20201119-0.20210126220548-d669c78c4306/go.mod h1:r0ExowOoGFfDoLDxx+M9SYbNVsoZ0xviLL+K4f2mt+A= +golang.zx2c4.com/wireguard v0.0.0-20210211144856-ef8115f63b22 h1:7Ct1Jps4o4u2hBFWrg8Rt65VmXfMPTeR0OSXxdq8gMk= +golang.zx2c4.com/wireguard v0.0.0-20210211144856-ef8115f63b22/go.mod h1:r0ExowOoGFfDoLDxx+M9SYbNVsoZ0xviLL+K4f2mt+A= diff --git a/tunnel/tools/wireguard-tools b/tunnel/tools/wireguard-tools -Subproject 265e81a344defb05bd7d420d125cde169b8995a +Subproject e8fa0f662f2541952e745d9c7fff0eeaec538a5 |