X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/cbcd9773eefbc20f52f7d9434f18540686f15036..d8078c7fcb4d8260ca2e9ebb78f43d71894be639:/print-ldp.c?ds=sidebyside diff --git a/print-ldp.c b/print-ldp.c index 50d14601..bdf9a138 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -16,9 +16,7 @@ /* \summary: Label Distribution Protocol (LDP) printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -287,7 +285,7 @@ ldp_tlv_print(netdissect_options *ndo, const struct ldp_tlv_header *ldp_tlv_header; u_short tlv_type,tlv_len,tlv_tlen,af,ft_flags; u_char fec_type, transport_pref; - u_int ui,vc_info_len, vc_info_tlv_type, vc_info_tlv_len,idx; + u_int ui,vc_info_len, vc_info_tlv_type, vc_info_tlv_len; char buf[100]; int i; @@ -502,8 +500,7 @@ ldp_tlv_print(netdissect_options *ndo, case LDP_FEC_MARTINI_IFPARM_DESC: ND_PRINT(": "); - for (idx = 2; idx < vc_info_tlv_len; idx++) - fn_print_char(ndo, GET_U_1(tptr + idx)); + nd_printjn(ndo, tptr + 2, vc_info_tlv_len - 2); break; case LDP_FEC_MARTINI_IFPARM_VCCV: @@ -689,7 +686,7 @@ ldp_pdu_print(netdissect_options *ndo, tptr = pptr + sizeof(struct ldp_common_header); tlen = pdu_len - (sizeof(struct ldp_common_header)-4); /* Type & Length fields not included */ - while(tlen>0) { + while(tlen != 0) { /* did we capture enough for fully decoding the msg header ? */ ND_TCHECK_LEN(tptr, sizeof(struct ldp_msg_header));