diff options
author | Kevin Krakauer <krakauer@google.com> | 2020-05-01 16:08:26 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-05-01 16:09:53 -0700 |
commit | 5e1e61fbcbe8fa3cc8b104fadb8cdef3ad29c31f (patch) | |
tree | dff4d88c41b32c8b2973ba0006d22c172c83e278 /pkg/tcpip/link/fdbased | |
parent | e7b8a71156b53f835c8d5ea01bdb1859e740649d (diff) |
Automated rollback of changelist 308674219
PiperOrigin-RevId: 309491861
Diffstat (limited to 'pkg/tcpip/link/fdbased')
-rw-r--r-- | pkg/tcpip/link/fdbased/endpoint.go | 3 |
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) } |