From bc81fccedae4c66e61a6b62eac44dd11fae413ac Mon Sep 17 00:00:00 2001 From: Ghanan Gowripalan Date: Wed, 25 Nov 2020 17:58:50 -0800 Subject: Support listener-side MLDv1 ...as defined by RFC 2710. Querier (router)-side MLDv1 is not yet supported. The core state machine is shared with IGMPv2. This is guarded behind a flag (ipv6.Options.MLDEnabled). Tests: ip_test.TestMGP* Bug #4861 PiperOrigin-RevId: 344344095 --- test/packetimpact/testbench/layers.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/packetimpact/testbench') diff --git a/test/packetimpact/testbench/layers.go b/test/packetimpact/testbench/layers.go index 7401a1991..9df072cfd 100644 --- a/test/packetimpact/testbench/layers.go +++ b/test/packetimpact/testbench/layers.go @@ -830,7 +830,9 @@ func (l *ICMPv6) ToBytes() ([]byte, error) { if l.Code != nil { h.SetCode(*l.Code) } - copy(h.NDPPayload(), l.Payload) + if n := copy(h.MessageBody(), l.Payload); n != len(l.Payload) { + panic(fmt.Sprintf("copied %d bytes, expected to copy %d bytes", n, len(l.Payload))) + } if l.Checksum != nil { h.SetChecksum(*l.Checksum) } else { @@ -876,7 +878,7 @@ func parseICMPv6(b []byte) (Layer, layerParser) { Type: ICMPv6Type(h.Type()), Code: ICMPv6Code(h.Code()), Checksum: Uint16(h.Checksum()), - Payload: h.NDPPayload(), + Payload: h.MessageBody(), } return &icmpv6, nil } -- cgit v1.2.3