aboutsummaryrefslogtreecommitdiffstats
path: root/wireguard-go-bridge
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-24 01:53:35 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-24 01:53:35 +0200
commit2ccbe0eb429ea0b8555a69bcb01e99c131026cc5 (patch)
tree3c400cf61dca6ba8f41dc10062a95e1686dca8cb /wireguard-go-bridge
parentTruth (diff)
downloadwireguard-apple-2ccbe0eb429ea0b8555a69bcb01e99c131026cc5.tar.xz
wireguard-apple-2ccbe0eb429ea0b8555a69bcb01e99c131026cc5.zip
Update go submodule
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'wireguard-go-bridge')
-rw-r--r--wireguard-go-bridge/src/git.zx2c4.com/wireguard-go/tun/tun_ios.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/wireguard-go-bridge/src/git.zx2c4.com/wireguard-go/tun/tun_ios.go b/wireguard-go-bridge/src/git.zx2c4.com/wireguard-go/tun/tun_ios.go
index fd8a1a13..93a0503f 100644
--- a/wireguard-go-bridge/src/git.zx2c4.com/wireguard-go/tun/tun_ios.go
+++ b/wireguard-go-bridge/src/git.zx2c4.com/wireguard-go/tun/tun_ios.go
@@ -51,8 +51,7 @@ func (tun *nativeTun) Events() chan TUNEvent {
}
func (tun *nativeTun) Read(buff []byte, offset int) (int, error) {
- buff = buff[offset:]
- ret := C.callFnWithCtx(tun.readFn, tun.ctx, unsafe.Pointer(&buff[0]), C.size_t(len(buff)))
+ ret := C.callFnWithCtx(tun.readFn, tun.ctx, unsafe.Pointer(&buff[offset]), C.size_t(len(buff) - offset))
if ret < 0 {
return 0, syscall.Errno(-ret)
}
@@ -60,8 +59,7 @@ func (tun *nativeTun) Read(buff []byte, offset int) (int, error) {
}
func (tun *nativeTun) Write(buff []byte, offset int) (int, error) {
- buff = buff[offset:]
- ret := C.callFnWithCtx(tun.writeFn, tun.ctx, unsafe.Pointer(&buff[0]), C.size_t(len(buff)))
+ ret := C.callFnWithCtx(tun.writeFn, tun.ctx, unsafe.Pointer(&buff[offset]), C.size_t(len(buff) - offset))
if ret < 0 {
return 0, syscall.Errno(-ret)
}