aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-11-06 15:43:09 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-11-06 15:43:09 +0100
commit6e6be3a326c848de4c321fe8e74c35cf21f6e194 (patch)
tree1cc9fa58eeb975d8eb5ec961145a213de0aefe08
parentlibwg-go: don't forget to include jni calls (diff)
downloadwireguard-android-6e6be3a326c848de4c321fe8e74c35cf21f6e194.tar.xz
wireguard-android-6e6be3a326c848de4c321fe8e74c35cf21f6e194.zip
libwg-go: do not mix C style and Go style variable names
-rw-r--r--app/tools/libwg-go/src/api-android.go10
-rw-r--r--app/tools/libwg-go/src/tun/api-android.go6
2 files changed, 8 insertions, 8 deletions
diff --git a/app/tools/libwg-go/src/api-android.go b/app/tools/libwg-go/src/api-android.go
index e57da84..fb34cc1 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}
diff --git a/app/tools/libwg-go/src/tun/api-android.go b/app/tools/libwg-go/src/tun/api-android.go
index 4f0dd96..ddc5d11 100644
--- a/app/tools/libwg-go/src/tun/api-android.go
+++ b/app/tools/libwg-go/src/tun/api-android.go
@@ -10,8 +10,8 @@ import (
"os"
)
-func CreateTUNFromFD(tun_fd int) (TUNDevice, string, error) {
- file := os.NewFile(uintptr(tun_fd), "/dev/tun")
+func CreateTUNFromFD(tunFd int) (TUNDevice, string, error) {
+ file := os.NewFile(uintptr(tunFd), "/dev/tun")
tun := &nativeTun{
tunFile: file,
fd: file.Fd(),
@@ -20,7 +20,7 @@ func CreateTUNFromFD(tun_fd int) (TUNDevice, string, error) {
nopi: true,
}
var err error
- tun.fdCancel, err = rwcancel.NewRWCancel(tun_fd)
+ tun.fdCancel, err = rwcancel.NewRWCancel(tunFd)
if err != nil {
return nil, "", err
}