X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/24df77f09e26a72f662a82b92645707e0572d1cc..7b4e6191a77bdaff6f04af00b93eafb718b33662:/print-ldp.c diff --git a/print-ldp.c b/print-ldp.c index 282bed62..896bc403 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -309,7 +309,6 @@ ldp_tlv_print(netdissect_options *ndo, switch (af) { case AFNUM_INET: while(tlv_tlen >= sizeof(nd_ipv4)) { - ND_TCHECK_LEN(tptr, sizeof(nd_ipv4)); ND_PRINT(" %s", GET_IPADDR_STRING(tptr)); tlv_tlen-=sizeof(nd_ipv4); tptr+=sizeof(nd_ipv4); @@ -539,8 +538,7 @@ ldp_tlv_print(netdissect_options *ndo, return(tlv_len+4); /* Type & Length fields not included */ trunc: - nd_print_trunc(ndo); - return 0; + nd_trunc_longjmp(ndo); invalid: return(tlv_len+4); /* Type & Length fields not included */ @@ -595,10 +593,10 @@ ldp_pdu_print(netdissect_options *ndo, pdu_len = GET_BE_U_2(ldp_com_header->pdu_length); if (pdu_len < sizeof(struct ldp_common_header)-4) { /* length too short */ - ND_PRINT("%sLDP, pdu-length: %u (too short, < %u)", - (ndo->ndo_vflag < 1) ? "" : "\n\t", - pdu_len, - (u_int)(sizeof(struct ldp_common_header)-4)); + ND_PRINT("%sLDP, pdu-length: %u (too short, < %zu)", + (ndo->ndo_vflag < 1) ? "" : "\n\t", + pdu_len, + sizeof(struct ldp_common_header)-4); return 0; } @@ -628,13 +626,13 @@ ldp_pdu_print(netdissect_options *ndo, if (msg_len < sizeof(struct ldp_msg_header)-4) { /* length too short */ /* FIXME vendor private / experimental check */ - ND_PRINT("\n\t %s Message (0x%04x), length: %u (too short, < %u)", - tok2str(ldp_msg_values, - "Unknown", - msg_type), - msg_type, - msg_len, - (u_int)(sizeof(struct ldp_msg_header)-4)); + ND_PRINT("\n\t %s Message (0x%04x), length: %u (too short, < %zu)", + tok2str(ldp_msg_values, + "Unknown", + msg_type), + msg_type, + msg_len, + sizeof(struct ldp_msg_header)-4); return 0; } @@ -698,6 +696,5 @@ ldp_pdu_print(netdissect_options *ndo, } return pdu_len+4; trunc: - nd_print_trunc(ndo); - return 0; + nd_trunc_longjmp(ndo); }