Update go submodule
This commit is contained in:
parent
63db75f088
commit
75a86c7cce
|
@ -1 +1 @@
|
|||
Subproject commit d0c23518371e9ae438e242ad5132e34832915c7e
|
||||
Subproject commit ebc7541953269b39cd73d703166b9b8ee7b34e37
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue