From: Francois-Xavier Le Bail Date: Sat, 11 Apr 2020 14:02:13 +0000 (+0200) Subject: IPv4/IPv6 demux: ICMPv4 in IPv6 is invalid X-Git-Tag: tcpdump-4.99-bp~456 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/ab22c228c885fd8eee863b1d47eecbf19f96bfb3 IPv4/IPv6 demux: ICMPv4 in IPv6 is invalid " ICMP messages are sent using the basic IP header. ... Version 4" (RFC 792) --- diff --git a/print-ip-demux.c b/print-ip-demux.c index d3f03b66..9d562d77 100644 --- a/print-ip-demux.c +++ b/print-ip-demux.c @@ -105,7 +105,13 @@ again: break; case IPPROTO_ICMP: - icmp_print(ndo, bp, length, iph, fragmented); + if (ver == 4) + icmp_print(ndo, bp, length, iph, fragmented); + else { + ND_PRINT("[%s requires IPv4]", + tok2str(ipproto_values,"unknown",nh)); + nd_print_invalid(ndo); + } break; case IPPROTO_ICMPV6: