From 3eb6c91c9edbe0d7e4f7bc1e731db8b5c38a72a8 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 6 Nov 2018 15:43:09 +0100 Subject: libwg-go: do not mix C style and Go style variable names Signed-off-by: Jason A. Donenfeld --- app/tools/libwg-go/src/api-android.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/tools/libwg-go/src/api-android.go') diff --git a/app/tools/libwg-go/src/api-android.go b/app/tools/libwg-go/src/api-android.go index e57da84f..fb34cc1a 100644 --- a/app/tools/libwg-go/src/api-android.go +++ b/app/tools/libwg-go/src/api-android.go @@ -60,7 +60,7 @@ func init() { } //export wgTurnOn -func wgTurnOn(ifnameRef string, tun_fd int32, settings string) int32 { +func wgTurnOn(ifnameRef string, tunFd int32, settings string) int32 { interfaceName := string([]byte(ifnameRef)) logger := &Logger{ @@ -71,9 +71,9 @@ func wgTurnOn(ifnameRef string, tun_fd int32, settings string) int32 { logger.Debug.Println("Debug log enabled") - tun, name, err := tun.CreateTUNFromFD(int(tun_fd)) + tun, name, err := tun.CreateTUNFromFD(int(tunFd)) if err != nil { - unix.Close(int(tun_fd)) + unix.Close(int(tunFd)) logger.Error.Println(err) return -1 } @@ -86,7 +86,7 @@ func wgTurnOn(ifnameRef string, tun_fd int32, settings string) int32 { bufferedSettings := bufio.NewReadWriter(bufio.NewReader(strings.NewReader(settings)), bufio.NewWriter(ioutil.Discard)) setError := ipcSetOperation(device, bufferedSettings) if setError != nil { - unix.Close(int(tun_fd)) + unix.Close(int(tunFd)) logger.Error.Println(setError) return -1 } @@ -124,7 +124,7 @@ func wgTurnOn(ifnameRef string, tun_fd int32, settings string) int32 { } } if i == math.MaxInt32 { - unix.Close(int(tun_fd)) + unix.Close(int(tunFd)) return -1 } tunnelHandles[i] = TunnelHandle{device: device, uapi: uapi} -- cgit v1.2.3