summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/rawfile
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-04-24 00:33:56 +0000
committergVisor bot <gvisor-bot@google.com>2020-04-24 00:33:56 +0000
commitc860716ef867306f28feccf25ab9c0066e3c5ffb (patch)
tree02ef0516b5fea1e5be8723d1c1999aa22f145282 /pkg/tcpip/link/rawfile
parent4b90fa57811fd8ad60e10cfe8fa0fca9edb7522c (diff)
parenteccae0f77d3708d591119488f427eca90de7c711 (diff)
Merge release-20200323.0-227-geccae0f (automated)
Diffstat (limited to 'pkg/tcpip/link/rawfile')
-rw-r--r--pkg/tcpip/link/rawfile/rawfile_unsafe.go6
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)),
},
{