X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3b8ff4bf0d8f389e00c19d6c094bce2bbf00deca..c518a9aab149da1a6b83c0cbeddaff5265d05dcb:/print-isoclns.c diff --git a/print-isoclns.c b/print-isoclns.c index e842a008..ddd55953 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -1022,8 +1022,6 @@ clnp_print(netdissect_options *ndo, } if (source_address_length > 0) { source_address=(tptr+1); - ND_TCHECK_LEN(source_address, - source_address_length); ND_PRINT("\n\t NSAP address (length %u): %s", source_address_length, GET_ISONSAP_STRING(source_address, source_address_length)); @@ -1300,7 +1298,7 @@ esis_print(netdissect_options *ndo, pptr += netal; li -= netal; - if (snpal == 6) + if (snpal == MAC_ADDR_LEN) ND_PRINT("\n\t SNPA (length: %u): %s", snpal, GET_ETHERADDR_STRING(snpa)); @@ -1467,8 +1465,7 @@ isis_print_mcid(netdissect_options *ndo, ND_TCHECK_SIZE(mcid); ND_PRINT("ID: %u, Name: ", GET_U_1(mcid->format_id)); - if (nd_printzp(ndo, mcid->name, 32, ndo->ndo_snapend)) - goto trunc; + nd_printjnp(ndo, mcid->name, sizeof(mcid->name)); ND_PRINT("\n\t Lvl: %u", GET_BE_U_2(mcid->revision_lvl)); @@ -2310,9 +2307,8 @@ isis_print_extd_ip_reach(netdissect_options *ndo, byte_length = (bit_length + 7) / 8; /* prefix has variable length encoding */ - ND_TCHECK_LEN(tptr, byte_length); memset(prefix, 0, sizeof(prefix)); /* clear the copy buffer */ - memcpy(prefix,tptr,byte_length); /* copy as much as is stored in the TLV */ + GET_CPY_BYTES(prefix,tptr,byte_length); /* copy as much as is stored in the TLV */ tptr+=byte_length; processed+=byte_length; @@ -2363,8 +2359,6 @@ isis_print_extd_ip_reach(netdissect_options *ndo, } } return (processed); -trunc: - return 0; } static void @@ -2891,7 +2885,6 @@ isis_print(netdissect_options *ndo, tlen--; if (tlen < alen) goto tlv_trunc; - ND_TCHECK_LEN(tptr, alen); ND_PRINT("\n\t Area address (length: %u): %s", alen, GET_ISONSAP_STRING(tptr, alen)); @@ -3123,8 +3116,7 @@ isis_print(netdissect_options *ndo, switch (auth_type) { case ISIS_SUBTLV_AUTH_SIMPLE: - if (nd_printzp(ndo, tptr, tlen, ndo->ndo_snapend)) - goto trunc; + nd_printjnp(ndo, tptr, tlen); break; case ISIS_SUBTLV_AUTH_MD5: for(i=0;indo_snapend)) - goto trunc; + nd_printjnp(ndo, tptr, tlen); break; case ISIS_TLV_SHARED_RISK_GROUP: @@ -3459,7 +3450,6 @@ isis_print(netdissect_options *ndo, } if (tlen < prefix_len/2) break; - ND_TCHECK_LEN(tptr, prefix_len / 2); ND_PRINT("\n\t\tAddress: %s/%u", GET_ISONSAP_STRING(tptr, prefix_len / 2), prefix_len * 4); tptr+=prefix_len/2;