summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/testbench/layers.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-07-23 13:25:33 -0700
committergVisor bot <gvisor-bot@google.com>2020-07-23 13:25:33 -0700
commitfc26b3764ecfe4f5a5eb7826a9fb46626738b391 (patch)
treec43fdaefe2c8f14d39da88cb4b4dc39b0b90c5f6 /test/packetimpact/testbench/layers.go
parent20b556e625354dd8330e30e4075ad06eedc6a2ce (diff)
parentfb8be7e6273f5a646cdf48e38743a2507a4bf64f (diff)
Merge pull request #3207 from kevinGC:icmp-connect
PiperOrigin-RevId: 322853192
Diffstat (limited to 'test/packetimpact/testbench/layers.go')
-rw-r--r--test/packetimpact/testbench/layers.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/packetimpact/testbench/layers.go b/test/packetimpact/testbench/layers.go
index 645f6c1a9..24aa46cce 100644
--- a/test/packetimpact/testbench/layers.go
+++ b/test/packetimpact/testbench/layers.go
@@ -805,7 +805,11 @@ func (l *ICMPv6) ToBytes() ([]byte, error) {
// We need to search forward to find the IPv6 header.
for prev := l.Prev(); prev != nil; prev = prev.Prev() {
if ipv6, ok := prev.(*IPv6); ok {
- h.SetChecksum(header.ICMPv6Checksum(h, *ipv6.SrcAddr, *ipv6.DstAddr, buffer.VectorisedView{}))
+ payload, err := payload(l)
+ if err != nil {
+ return nil, err
+ }
+ h.SetChecksum(header.ICMPv6Checksum(h, *ipv6.SrcAddr, *ipv6.DstAddr, payload))
break
}
}