diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-24 00:33:56 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-24 00:33:56 +0000 |
commit | c860716ef867306f28feccf25ab9c0066e3c5ffb (patch) | |
tree | 02ef0516b5fea1e5be8723d1c1999aa22f145282 /pkg/tcpip/link/rawfile | |
parent | 4b90fa57811fd8ad60e10cfe8fa0fca9edb7522c (diff) | |
parent | eccae0f77d3708d591119488f427eca90de7c711 (diff) |
Merge release-20200323.0-227-geccae0f (automated)
Diffstat (limited to 'pkg/tcpip/link/rawfile')
-rw-r--r-- | pkg/tcpip/link/rawfile/rawfile_unsafe.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/tcpip/link/rawfile/rawfile_unsafe.go b/pkg/tcpip/link/rawfile/rawfile_unsafe.go index 44e25d475..92efd0bf8 100644 --- a/pkg/tcpip/link/rawfile/rawfile_unsafe.go +++ b/pkg/tcpip/link/rawfile/rawfile_unsafe.go @@ -76,9 +76,13 @@ func NonBlockingWrite3(fd int, b1, b2, b3 []byte) *tcpip.Error { // We have two buffers. Build the iovec that represents them and issue // a writev syscall. + var base *byte + if len(b1) > 0 { + base = &b1[0] + } iovec := [3]syscall.Iovec{ { - Base: &b1[0], + Base: base, Len: uint64(len(b1)), }, { |