X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ee68aa36460d7efeca48747f33b7f2adc0900bfb..refs/heads/mcr-macro-update-1:/print-vtp.c diff --git a/print-vtp.c b/print-vtp.c index e2b1f9ff..e1b8377a 100644 --- a/print-vtp.c +++ b/print-vtp.c @@ -13,8 +13,8 @@ * FOR A PARTICULAR PURPOSE. * * Reference documentation: - * http://www.cisco.com/c/en/us/support/docs/lan-switching/vtp/10558-21.html - * http://docstore.mik.ua/univercd/cc/td/doc/product/lan/trsrb/frames.htm + * https://www.cisco.com/c/en/us/support/docs/lan-switching/vtp/10558-21.html + * https://docstore.mik.ua/univercd/cc/td/doc/product/lan/trsrb/frames.htm * * Original code ode by Carles Kishimoto */ @@ -184,7 +184,7 @@ vtp_print(netdissect_options *ndo, ND_TCHECK_8(tptr); ND_PRINT("\n\t Config Rev %x, Updater %s", GET_BE_U_4(tptr), - ipaddr_string(ndo, tptr+4)); + GET_IPADDR_STRING(tptr+4)); tptr += 8; ND_TCHECK_LEN(tptr, VTP_UPDATE_TIMESTAMP_LEN); ND_PRINT(", Timestamp 0x%08x 0x%08x 0x%08x", @@ -223,7 +223,6 @@ vtp_print(netdissect_options *ndo, * */ - ND_TCHECK_4(tptr); ND_PRINT(", Config Rev %x", GET_BE_U_4(tptr)); /* @@ -242,9 +241,8 @@ vtp_print(netdissect_options *ndo, */ tptr += 4; - while (tptr < (pptr+length)) { + while ((unsigned)(tptr - pptr) < length) { - ND_TCHECK_1(tptr); len = GET_U_1(tptr); if (len == 0) break; @@ -281,7 +279,7 @@ vtp_print(netdissect_options *ndo, /* * Cisco specs say 2 bytes for type + 2 bytes for length; - * see http://docstore.mik.ua/univercd/cc/td/doc/product/lan/trsrb/frames.htm + * see https://docstore.mik.ua/univercd/cc/td/doc/product/lan/trsrb/frames.htm * However, actual packets on the wire appear to use 1 * byte for the type and 1 byte for the length, so that's * what we do. @@ -378,7 +376,6 @@ vtp_print(netdissect_options *ndo, * */ - ND_TCHECK_4(tptr); ND_PRINT("\n\tStart value: %u", GET_BE_U_4(tptr)); break;