summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/udp
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/udp
parent77dfca5954fab10c93faff1236d9e42d84defc22 (diff)
parent6c0e1d9cfe6adbfbb32e7020d6426608ac63ad37 (diff)
Merge release-20210112.0-74-g6c0e1d9cf (automated)
Diffstat (limited to 'pkg/tcpip/transport/udp')
-rw-r--r--pkg/tcpip/transport/udp/endpoint.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/tcpip/transport/udp/endpoint.go b/pkg/tcpip/transport/udp/endpoint.go
index 9f9b3d510..8544fcb08 100644
--- a/pkg/tcpip/transport/udp/endpoint.go
+++ b/pkg/tcpip/transport/udp/endpoint.go
@@ -514,9 +514,9 @@ func (e *endpoint) write(p tcpip.Payloader, opts tcpip.WriteOptions) (int64, *tc
return 0, tcpip.ErrBroadcastDisabled
}
- v, err := p.FullPayload()
- if err != nil {
- return 0, err
+ v := make([]byte, p.Len())
+ if _, err := io.ReadFull(p, v); err != nil {
+ return 0, tcpip.ErrBadBuffer
}
if len(v) > header.UDPMaximumPacketSize {
// Payload can't possibly fit in a packet.