X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e3b8b6f5cb34b8a39f7bb105ca42b9589e454593..b5068d5380c73e02bc35a96f641cad18d9b03f3d:/print-ip-demux.c?ds=sidebyside diff --git a/print-ip-demux.c b/print-ip-demux.c index d3f03b66..7df0f709 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: @@ -155,7 +161,13 @@ again: break; case IPPROTO_IGMP: - igmp_print(ndo, bp, length); + if (ver == 4) + igmp_print(ndo, bp, length); + else { + ND_PRINT("[%s requires IPv4]", + tok2str(ipproto_values,"unknown",nh)); + nd_print_invalid(ndo); + } break; case IPPROTO_IPV4: