summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/packetimpact/tests')
-rw-r--r--test/packetimpact/tests/ipv4_fragment_reassembly_test.go6
-rw-r--r--test/packetimpact/tests/ipv6_fragment_icmp_error_test.go14
-rw-r--r--test/packetimpact/tests/ipv6_fragment_reassembly_test.go14
3 files changed, 15 insertions, 19 deletions
diff --git a/test/packetimpact/tests/ipv4_fragment_reassembly_test.go b/test/packetimpact/tests/ipv4_fragment_reassembly_test.go
index ee050e2c6..707f0f1f5 100644
--- a/test/packetimpact/tests/ipv4_fragment_reassembly_test.go
+++ b/test/packetimpact/tests/ipv4_fragment_reassembly_test.go
@@ -21,7 +21,6 @@ import (
"time"
"github.com/google/go-cmp/cmp"
- "gvisor.dev/gvisor/pkg/tcpip/buffer"
"gvisor.dev/gvisor/pkg/tcpip/header"
"gvisor.dev/gvisor/test/packetimpact/testbench"
)
@@ -118,10 +117,7 @@ func TestIPv4FragmentReassembly(t *testing.T) {
if _, err := rand.Read(originalPayload); err != nil {
t.Fatalf("rand.Read: %s", err)
}
- cksum := header.ICMPv4Checksum(
- icmp,
- buffer.NewVectorisedView(len(originalPayload), []buffer.View{originalPayload}),
- )
+ cksum := header.ICMPv4Checksum(icmp, header.Checksum(originalPayload, 0 /* initial */))
icmp.SetChecksum(cksum)
for _, fragment := range test.fragments {
diff --git a/test/packetimpact/tests/ipv6_fragment_icmp_error_test.go b/test/packetimpact/tests/ipv6_fragment_icmp_error_test.go
index e0b2a2178..4034a128e 100644
--- a/test/packetimpact/tests/ipv6_fragment_icmp_error_test.go
+++ b/test/packetimpact/tests/ipv6_fragment_icmp_error_test.go
@@ -21,7 +21,6 @@ import (
"github.com/google/go-cmp/cmp"
"gvisor.dev/gvisor/pkg/tcpip"
- "gvisor.dev/gvisor/pkg/tcpip/buffer"
"gvisor.dev/gvisor/pkg/tcpip/header"
"gvisor.dev/gvisor/pkg/tcpip/network/ipv6"
"gvisor.dev/gvisor/test/packetimpact/testbench"
@@ -45,12 +44,13 @@ func fragmentedICMPEchoRequest(t *testing.T, n *testbench.DUTTestNet, conn *test
icmpv6Header.SetCode(header.ICMPv6UnusedCode)
icmpv6Header.SetIdent(0)
icmpv6Header.SetSequence(0)
- cksum := header.ICMPv6Checksum(
- icmpv6Header,
- tcpip.Address(n.LocalIPv6),
- tcpip.Address(n.RemoteIPv6),
- buffer.NewVectorisedView(len(payload), []buffer.View{payload}),
- )
+ cksum := header.ICMPv6Checksum(header.ICMPv6ChecksumParams{
+ Header: icmpv6Header,
+ Src: tcpip.Address(n.LocalIPv6),
+ Dst: tcpip.Address(n.RemoteIPv6),
+ PayloadCsum: header.Checksum(payload, 0 /* initial */),
+ PayloadLen: len(payload),
+ })
icmpv6Header.SetChecksum(cksum)
icmpv6Bytes := append([]byte(icmpv6Header), payload...)
diff --git a/test/packetimpact/tests/ipv6_fragment_reassembly_test.go b/test/packetimpact/tests/ipv6_fragment_reassembly_test.go
index dd98ee7a1..db6195dc9 100644
--- a/test/packetimpact/tests/ipv6_fragment_reassembly_test.go
+++ b/test/packetimpact/tests/ipv6_fragment_reassembly_test.go
@@ -22,7 +22,6 @@ import (
"github.com/google/go-cmp/cmp"
"gvisor.dev/gvisor/pkg/tcpip"
- "gvisor.dev/gvisor/pkg/tcpip/buffer"
"gvisor.dev/gvisor/pkg/tcpip/header"
"gvisor.dev/gvisor/test/packetimpact/testbench"
)
@@ -121,12 +120,13 @@ func TestIPv6FragmentReassembly(t *testing.T) {
t.Fatalf("rand.Read: %s", err)
}
- cksum := header.ICMPv6Checksum(
- icmp,
- lIP,
- rIP,
- buffer.NewVectorisedView(len(originalPayload), []buffer.View{originalPayload}),
- )
+ cksum := header.ICMPv6Checksum(header.ICMPv6ChecksumParams{
+ Header: icmp,
+ Src: lIP,
+ Dst: rIP,
+ PayloadCsum: header.Checksum(originalPayload, 0 /* initial */),
+ PayloadLen: len(originalPayload),
+ })
icmp.SetChecksum(cksum)
for _, fragment := range test.fragments {