summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/sharedmem
diff options
context:
space:
mode:
authorTing-Yu Wang <anivia@google.com>2021-03-03 16:03:04 -0800
committergVisor bot <gvisor-bot@google.com>2021-03-03 16:05:16 -0800
commit1cd76d958a9b3eb29f6b55a8bea71fbe464e67d3 (patch)
tree1f4df3b516c62a2aa630ffaf9c6ecba99482e3d3 /pkg/tcpip/link/sharedmem
parentcfd2c31962a4358d7d05a4bd04dde271dc238339 (diff)
Make dedicated methods for data operations in PacketBuffer
One of the preparation to decouple underlying buffer implementation. There are still some methods that tie to VectorisedView, and they will be changed gradually in later CLs. This CL also introduce a new ICMPv6ChecksumParams to replace long list of parameters when calling ICMPv6Checksum, aiming to be more descriptive. PiperOrigin-RevId: 360778149
Diffstat (limited to 'pkg/tcpip/link/sharedmem')
-rw-r--r--pkg/tcpip/link/sharedmem/sharedmem_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/tcpip/link/sharedmem/sharedmem_test.go b/pkg/tcpip/link/sharedmem/sharedmem_test.go
index def47772f..d4b3ddd5c 100644
--- a/pkg/tcpip/link/sharedmem/sharedmem_test.go
+++ b/pkg/tcpip/link/sharedmem/sharedmem_test.go
@@ -80,7 +80,7 @@ func (q *queueBuffers) cleanup() {
type packetInfo struct {
addr tcpip.LinkAddress
proto tcpip.NetworkProtocolNumber
- vv buffer.VectorisedView
+ data buffer.View
linkHeader buffer.View
}
@@ -136,7 +136,7 @@ func (c *testContext) DeliverNetworkPacket(remoteLinkAddr, localLinkAddr tcpip.L
c.packets = append(c.packets, packetInfo{
addr: remoteLinkAddr,
proto: proto,
- vv: pkt.Data.Clone(nil),
+ data: pkt.Data().AsRange().ToOwnedView(),
})
c.mu.Unlock()
@@ -676,7 +676,7 @@ func TestSimpleReceive(t *testing.T) {
// Wait for packet to be received, then check it.
c.waitForPackets(1, time.After(5*time.Second), "Timeout waiting for packet")
c.mu.Lock()
- rcvd := []byte(c.packets[0].vv.ToView())
+ rcvd := []byte(c.packets[0].data)
c.packets = c.packets[:0]
c.mu.Unlock()