summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/raw
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-01-22 20:40:39 +0000
committergVisor bot <gvisor-bot@google.com>2021-01-22 20:40:39 +0000
commit993bee6697b0e371d902f18b81787c14d12180f5 (patch)
tree0a35ed69a975448d874b765fbae6e229dd19621b /pkg/tcpip/transport/raw
parent77dfca5954fab10c93faff1236d9e42d84defc22 (diff)
parent6c0e1d9cfe6adbfbb32e7020d6426608ac63ad37 (diff)
Merge release-20210112.0-74-g6c0e1d9cf (automated)
Diffstat (limited to 'pkg/tcpip/transport/raw')
-rw-r--r--pkg/tcpip/transport/raw/endpoint.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/tcpip/transport/raw/endpoint.go b/pkg/tcpip/transport/raw/endpoint.go
index ae743f75e..2dacf5a64 100644
--- a/pkg/tcpip/transport/raw/endpoint.go
+++ b/pkg/tcpip/transport/raw/endpoint.go
@@ -280,9 +280,9 @@ func (e *endpoint) write(p tcpip.Payloader, opts tcpip.WriteOptions) (int64, *tc
return 0, tcpip.ErrInvalidEndpointState
}
- payloadBytes, err := p.FullPayload()
- if err != nil {
- return 0, err
+ payloadBytes := make([]byte, p.Len())
+ if _, err := io.ReadFull(p, payloadBytes); err != nil {
+ return 0, tcpip.ErrBadBuffer
}
// If this is an unassociated socket and callee provided a nonzero