X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/4aac37f04316b37b73b99bdcdbfa97347bb2fe51..0023eaa78f123676bfa9c5fba72ea4b8a59aaa70:/print-lmp.c diff --git a/print-lmp.c b/print-lmp.c index 525b12c6..66ac2030 100644 --- a/print-lmp.c +++ b/print-lmp.c @@ -20,12 +20,11 @@ /* specification: RFC 4204 */ /* OIF UNI 1.0: https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" +#define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" #include "extract.h" #include "addrtoname.h" @@ -427,7 +426,6 @@ lmp_print(netdissect_options *ndo, const u_char *pptr, u_int length) { const struct lmp_common_header *lmp_com_header; - const struct lmp_object_header *lmp_obj_header; const u_char *tptr,*obj_tptr; u_int version_res, tlen, lmp_obj_len, lmp_obj_ctype, obj_tlen; int hexdump; @@ -486,10 +484,8 @@ lmp_print(netdissect_options *ndo, tlen-=sizeof(struct lmp_common_header); while(tlen>0) { - /* did we capture enough for fully decoding the object header ? */ - ND_TCHECK_LEN(tptr, sizeof(struct lmp_object_header)); - - lmp_obj_header = (const struct lmp_object_header *)tptr; + const struct lmp_object_header *lmp_obj_header = + (const struct lmp_object_header *)tptr; lmp_obj_len=GET_BE_U_2(lmp_obj_header->length); lmp_obj_ctype=GET_U_1(lmp_obj_header->ctype)&0x7f; @@ -1136,7 +1132,4 @@ lmp_print(netdissect_options *ndo, tptr+=lmp_obj_len; tlen-=lmp_obj_len; } - return; -trunc: - nd_print_trunc(ndo); }