If the length is zero, it's invalid, print that.
Add a test with this case.
oip = (const struct ip6_hdr *)(dp + 1);
/* 'ep' points to the end of available data. */
ep = ndo->ndo_snapend;
+ if (length == 0) {
+ ND_PRINT("ICMP6, length 0");
+ ND_PRINT("%s", istr);
+ return;
+ }
if (ndo->ndo_vflag && !fragmented) {
uint16_t sum, udp_sum;
# ICMPv6
icmpv6 icmpv6.pcap icmpv6.out -vv
icmpv6_opt24-v icmpv6_opt24.pcap icmpv6_opt24-v.out -v
+icmpv6-length-zero icmpv6-length-zero.pcapng icmpv6-length-zero.out
# SPB tests
spb spb.pcap spb.out
--- /dev/null
+IP6 fe80::25a:28ff:fe08:f150 > 6e02::41: ICMP6, length 0 (invalid)