summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/sharedmem/sharedmem.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip/link/sharedmem/sharedmem.go')
-rw-r--r--pkg/tcpip/link/sharedmem/sharedmem.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/pkg/tcpip/link/sharedmem/sharedmem.go b/pkg/tcpip/link/sharedmem/sharedmem.go
index 6bd5441f6..0dd23794b 100644
--- a/pkg/tcpip/link/sharedmem/sharedmem.go
+++ b/pkg/tcpip/link/sharedmem/sharedmem.go
@@ -227,8 +227,6 @@ func (e *endpoint) dispatchLoop(d stack.NetworkDispatcher) {
// Read in a loop until a stop is requested.
var rxb []queue.RxBuffer
- views := []buffer.View{nil}
- vv := buffer.NewVectorisedView(0, views)
for atomic.LoadUint32(&e.stopRequested) == 0 {
var n uint32
rxb, n = e.rx.postAndReceive(rxb, &e.stopRequested)
@@ -250,9 +248,7 @@ func (e *endpoint) dispatchLoop(d stack.NetworkDispatcher) {
// Send packet up the stack.
eth := header.Ethernet(b)
- views[0] = b[header.EthernetMinimumSize:]
- vv.SetSize(int(n) - header.EthernetMinimumSize)
- d.DeliverNetworkPacket(e, eth.SourceAddress(), eth.Type(), &vv)
+ d.DeliverNetworkPacket(e, eth.SourceAddress(), eth.Type(), buffer.View(b[header.EthernetMinimumSize:]).ToVectorisedView())
}
// Clean state.