From 4c3289aa52415a02f2d3d4e3c51983c61ff49c02 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 11 Feb 2021 16:00:28 +0100 Subject: tunnel: bump all tools Signed-off-by: Jason A. Donenfeld --- tunnel/tools/libwg-go/api-android.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tunnel/tools/libwg-go/api-android.go') 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} -- cgit v1.2.3