summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/fdbased
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-05-01 23:14:25 +0000
committergVisor bot <gvisor-bot@google.com>2020-05-01 23:14:25 +0000
commitf7891792e2cd4371c22e6a5218dba42df1b14d8b (patch)
treeeeae48568d09f136ba741a4d96ff4834827927e0 /pkg/tcpip/link/fdbased
parenta0b1393845a7cd6bf9da3b7d83e5c044989f204e (diff)
parent5e1e61fbcbe8fa3cc8b104fadb8cdef3ad29c31f (diff)
Merge release-20200422.0-11-g5e1e61f (automated)
Diffstat (limited to 'pkg/tcpip/link/fdbased')
-rw-r--r--pkg/tcpip/link/fdbased/endpoint.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/tcpip/link/fdbased/endpoint.go b/pkg/tcpip/link/fdbased/endpoint.go
index 53a9712c6..affa1bbdf 100644
--- a/pkg/tcpip/link/fdbased/endpoint.go
+++ b/pkg/tcpip/link/fdbased/endpoint.go
@@ -436,6 +436,9 @@ func (e *endpoint) WritePacket(r *stack.Route, gso *stack.GSO, protocol tcpip.Ne
if pkt.Data.Size() == 0 {
return rawfile.NonBlockingWrite(fd, pkt.Header.View())
}
+ if pkt.Header.UsedLength() == 0 {
+ return rawfile.NonBlockingWrite(fd, pkt.Data.ToView())
+ }
return rawfile.NonBlockingWrite3(fd, pkt.Header.View(), pkt.Data.ToView(), nil)
}