#include "netdissect-stdinc.h"
-#include <string.h>
-
#include "netdissect.h"
#include "addrtoname.h"
#include "extract.h"
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:
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:
if (ndo->ndo_packettype == PT_CARP) {
carp_print(ndo, bp, length, ttl_hl);
} else {
- vrrp_print(ndo, bp, length, iph, ttl_hl);
+ vrrp_print(ndo, bp, length, iph, ttl_hl, ver);
}
break;
pgm_print(ndo, bp, length, iph);
break;
+ case IPPROTO_ETHERNET:
+ if (ver == 6)
+ ether_print(ndo, bp, length, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
+ else {
+ ND_PRINT("[%s requires IPv6]",
+ tok2str(ipproto_values,"unknown",nh));
+ nd_print_invalid(ndo);
+ }
+ break;
+
case IPPROTO_NONE:
ND_PRINT("no next header");
break;