How to send icmpv6NS packets through gopacket
- Dominant language
- Go
- Stars
- 6.8k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
```go
ethernetLayer := &layers.Ethernet{
SrcMAC: srcMac,
DstMAC: dstMac,
EthernetType: layers.EthernetTypeIPv6,
}
ipv6layers := &layers.IPv6{
Version: 6,
SrcIP: srcIP,
DstIP: snm,
NextHeader: layers.IPProtocolICMPv6,
}
icmplayers := &layers.ICMPv6NeighborSolicitation{
TargetAddress: srcIP,
}
buffer := gopacket.NewSerializeBuffer()
opts := gopacket.SerializeOptions{
FixLengths: true,
ComputeChecksums: true,
}
err := gopacket.SerializeLayers(buffer, opts,
ethernetLayer,
ipv6layers,
icmplayers,
)
```
Through the above construction of data packet transmission, it is found that the data packet is defective in wireshark capture.
Is there something wrong with the icmp-layers construction?

Contributor guide
Assessment
This issue has not been assessed yet.