Update go submodule

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-09-24 01:53:35 +02:00
parent 8a99806257
commit 2ccbe0eb42
2 changed files with 3 additions and 5 deletions

@ -1 +1 @@
Subproject commit d0c23518371e9ae438e242ad5132e34832915c7e
Subproject commit ebc7541953269b39cd73d703166b9b8ee7b34e37

View 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)
}