diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-10-31 00:15:09 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-10-31 00:15:09 +0000 |
commit | 2de2a361f28b7b7a98c3c29497c8284b82c83843 (patch) | |
tree | 1e8d19089052e39d5d189c970c26c959b6f1d3c4 /pkg/tcpip/transport/packet/endpoint.go | |
parent | c8b32980f2c8f5aec7b97fa5f06eb81733df93ad (diff) | |
parent | 3246040447c6d0a08cc12c5721480c06f77f5dfe (diff) |
Merge release-20190806.1-350-g3246040 (automated)
Diffstat (limited to 'pkg/tcpip/transport/packet/endpoint.go')
-rwxr-xr-x | pkg/tcpip/transport/packet/endpoint.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/pkg/tcpip/transport/packet/endpoint.go b/pkg/tcpip/transport/packet/endpoint.go index 73cdaa265..ead83b83d 100755 --- a/pkg/tcpip/transport/packet/endpoint.go +++ b/pkg/tcpip/transport/packet/endpoint.go @@ -41,10 +41,6 @@ type packet struct { // data holds the actual packet data, including any headers and // payload. data buffer.VectorisedView `state:".(buffer.VectorisedView)"` - // views is pre-allocated space to back data. As long as the packet is - // made up of fewer than 8 buffer.Views, no extra allocation is - // necessary to store packet data. - views [8]buffer.View `state:"nosave"` // timestampNS is the unix time at which the packet was received. timestampNS int64 // senderAddr is the network address of the sender. @@ -310,7 +306,7 @@ func (ep *endpoint) HandlePacket(nicid tcpip.NICID, localAddr tcpip.LinkAddress, if ep.cooked { // Cooked packets can simply be queued. - packet.data = vv.Clone(packet.views[:]) + packet.data = vv } else { // Raw packets need their ethernet headers prepended before // queueing. @@ -328,7 +324,7 @@ func (ep *endpoint) HandlePacket(nicid tcpip.NICID, localAddr tcpip.LinkAddress, } combinedVV := buffer.View(ethHeader).ToVectorisedView() combinedVV.Append(vv) - packet.data = combinedVV.Clone(packet.views[:]) + packet.data = combinedVV } packet.timestampNS = ep.stack.NowNanoseconds() |