X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/da20bc56d6100b5275d6f85c4a25bac1dab4e57e..0d52da1a967932f479912f8049b35c0112a7c708:/print-udld.c diff --git a/print-udld.c b/print-udld.c index 69bdea46..0bc71ea8 100644 --- a/print-udld.c +++ b/print-udld.c @@ -104,12 +104,12 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) tptr = pptr; - ND_TCHECK2(*tptr, UDLD_HEADER_LEN); + ND_TCHECK_LEN(tptr, UDLD_HEADER_LEN); - code = UDLD_EXTRACT_OPCODE(*tptr); + code = UDLD_EXTRACT_OPCODE(EXTRACT_U_1(tptr)); ND_PRINT((ndo, "UDLDv%u, Code %s (%x), Flags [%s] (0x%02x), length %u", - UDLD_EXTRACT_VERSION(*tptr), + UDLD_EXTRACT_VERSION(EXTRACT_U_1(tptr)), tok2str(udld_code_values, "Reserved", code), code, bittok2str(udld_flags_values, "none", EXTRACT_U_1((tptr + 1))), @@ -129,7 +129,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) while (tptr < (pptr+length)) { - ND_TCHECK2(*tptr, 4); + ND_TCHECK_4(tptr); type = EXTRACT_BE_U_2(tptr); len = EXTRACT_BE_U_2(tptr + 2); @@ -147,7 +147,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) len -= 4; tptr += 4; - ND_TCHECK2(*tptr, len); + ND_TCHECK_LEN(tptr, len); switch (type) { case UDLD_DEVICE_ID_TLV: @@ -166,7 +166,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) case UDLD_TIMEOUT_INTERVAL_TLV: if (len != 1) goto invalid; - ND_PRINT((ndo, ", %us", (*tptr))); + ND_PRINT((ndo, ", %us", (EXTRACT_U_1(tptr)))); break; case UDLD_SEQ_NUMBER_TLV: