diff options
author | Tamir Duberstein <tamird@google.com> | 2018-09-12 21:57:04 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-09-12 21:57:55 -0700 |
commit | d689f8422fd55f74f6fc677f33b2bbf3720de89e (patch) | |
tree | 729ba29346fa74ac4a413f6f619d9e85ceb0ae78 /pkg/dhcp/dhcp_test.go | |
parent | 5adb3468d4de249df055d641e01ce6582b3a9388 (diff) |
Always pass buffer.VectorisedView by value
PiperOrigin-RevId: 212757571
Change-Id: I04200df9e45c21eb64951cd2802532fa84afcb1a
Diffstat (limited to 'pkg/dhcp/dhcp_test.go')
-rw-r--r-- | pkg/dhcp/dhcp_test.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pkg/dhcp/dhcp_test.go b/pkg/dhcp/dhcp_test.go index 67814683a..a187c5c2a 100644 --- a/pkg/dhcp/dhcp_test.go +++ b/pkg/dhcp/dhcp_test.go @@ -42,11 +42,7 @@ func createStack(t *testing.T) *stack.Stack { go func() { for pkt := range linkEP.C { - v := make(buffer.View, len(pkt.Header)+len(pkt.Payload)) - copy(v, pkt.Header) - copy(v[len(pkt.Header):], pkt.Payload) - vv := v.ToVectorisedView([1]buffer.View{}) - linkEP.Inject(pkt.Proto, &vv) + linkEP.Inject(pkt.Proto, buffer.NewVectorisedView(len(pkt.Header)+len(pkt.Payload), []buffer.View{pkt.Header, pkt.Payload})) } }() |