diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-03-01 20:21:56 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-03-01 20:21:56 +0000 |
commit | 6b785c5e3d79cb32ce49dec2aa97bec8e9725409 (patch) | |
tree | bcbb53994fa907e60dcd41f6900c70507f1c3ea3 /pkg | |
parent | 0c7b403661d5dfdee9580fcc16a2921ec0a433af (diff) | |
parent | 865ca64ee8c0af9eba88a4a04e0730630fae6d8b (diff) |
Merge release-20210208.0-106-g865ca64ee (automated)
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/tcpip/transport/tcp/endpoint.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go index 83ec99fa9..f47b39ccc 100644 --- a/pkg/tcpip/transport/tcp/endpoint.go +++ b/pkg/tcpip/transport/tcp/endpoint.go @@ -1552,10 +1552,11 @@ func (e *endpoint) Write(p tcpip.Payloader, opts tcpip.WriteOptions) (int64, tcp return nil, nil } v := make([]byte, avail) - if _, err := io.ReadFull(p, v); err != nil { + n, err := p.Read(v) + if err != nil && err != io.EOF { return nil, &tcpip.ErrBadBuffer{} } - return v, nil + return v[:n], nil }() if len(v) == 0 || err != nil { return nil, 0, err |