#include "netdissect-stdinc.h"
+#define ND_LONGJMP_FROM_TCHECK
#include "netdissect.h"
#include "addrtoname.h"
#include "extract.h"
ndo->ndo_protocol = "mobile";
mob = (const struct mobile_ip *)bp;
- if (length < MOBILE_SIZE || !ND_TTEST_SIZE(mob)) {
- nd_print_trunc(ndo);
- return;
- }
- ND_PRINT("mobile: ");
+ ND_ICHECK_U(length, <, MOBILE_SIZE);
+ ND_TCHECK_SIZE(mob);
+ nd_print_protocol(ndo);
+ ND_PRINT(": ");
proto = GET_BE_U_2(mob->proto);
crc = GET_BE_U_2(mob->hcheck);
if (in_cksum(vec, 1)!=0) {
ND_PRINT(" (bad checksum %u)", crc);
}
+ return;
+invalid:
+ nd_print_invalid(ndo);
}