]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Update go submodule
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 23 Sep 2018 23:53:35 +0000 (01:53 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 23 Sep 2018 23:53:35 +0000 (01:53 +0200)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
wireguard-go
wireguard-go-bridge/src/git.zx2c4.com/wireguard-go/tun/tun_ios.go

index d0c23518371e9ae438e242ad5132e34832915c7e..ebc7541953269b39cd73d703166b9b8ee7b34e37 160000 (submodule)
@@ -1 +1 @@
-Subproject commit d0c23518371e9ae438e242ad5132e34832915c7e
+Subproject commit ebc7541953269b39cd73d703166b9b8ee7b34e37
index fd8a1a13e7d2267da7c9364d86d727a090e8885e..93a0503f31bd1b187d66780bd7be6c5aad10b978 100644 (file)
@@ -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)
        }