diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-12 00:45:50 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-12 01:11:43 +0100 |
commit | 034a1a12f7849276823546f369b00507dc8029ce (patch) | |
tree | 47ad6263978713be38e331c877602ba622e6d9d1 /wireguard-go-bridge/src | |
parent | Fixed a potential race condition, better naming on PacketTunnelSettingsGenerator methods (diff) | |
download | wireguard-apple-034a1a12f7849276823546f369b00507dc8029ce.tar.xz wireguard-apple-034a1a12f7849276823546f369b00507dc8029ce.zip |
Supply missing pieces of path change
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'wireguard-go-bridge/src')
-rw-r--r-- | wireguard-go-bridge/src/api-ios.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/wireguard-go-bridge/src/api-ios.go b/wireguard-go-bridge/src/api-ios.go index ff7aab2..3d35d1e 100644 --- a/wireguard-go-bridge/src/api-ios.go +++ b/wireguard-go-bridge/src/api-ios.go @@ -128,16 +128,27 @@ func wgTurnOff(tunnelHandle int32) { } //export wgSetConfig -func wgSetConfig(tunnelHandle int32, settings string) { +func wgSetConfig(tunnelHandle int32, settings string) int64 { device, ok := tunnelHandles[tunnelHandle] if !ok { - return + return 0 } bufferedSettings := bufio.NewReadWriter(bufio.NewReader(strings.NewReader(settings)), bufio.NewWriter(ioutil.Discard)) err := ipcSetOperation(device, bufferedSettings) if err != nil { device.log.Error.Println(err) + return err.Code + } + return 0 +} + +//export wgGetListenPort +func wgGetListenPort(tunnelHandle int32) uint16 { + device, ok := tunnelHandles[tunnelHandle] + if !ok { + return 0 } + return device.net.port } //export wgVersion |