summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/buffer
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-11-14 18:19:35 +0000
committergVisor bot <gvisor-bot@google.com>2019-11-14 18:19:35 +0000
commitaac22c4734706966cecec88a94a51082594e32fc (patch)
treeeb4fe50786baf0966e6ba7b8cdb0f23af47349ea /pkg/tcpip/buffer
parentf92854de80c4c466015ea7ee37c9cdc1a4d01ea8 (diff)
parent3f7d9370909a598cf83dfa07a1e87545a66e182f (diff)
Merge release-20191104.0-40-g3f7d937 (automated)
Diffstat (limited to 'pkg/tcpip/buffer')
-rw-r--r--pkg/tcpip/buffer/prependable.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/tcpip/buffer/prependable.go b/pkg/tcpip/buffer/prependable.go
index 48a2a2713..ba21f4eca 100644
--- a/pkg/tcpip/buffer/prependable.go
+++ b/pkg/tcpip/buffer/prependable.go
@@ -77,3 +77,9 @@ func (p *Prependable) Prepend(size int) []byte {
p.usedIdx -= size
return p.View()[:size:size]
}
+
+// DeepCopy copies p and the bytes backing it.
+func (p Prependable) DeepCopy() Prependable {
+ p.buf = append(View(nil), p.buf...)
+ return p
+}