*/
#define TLV_TCHECK(minlen) \
- ND_TCHECK2(*tptr, minlen); if (tlv_tlen < minlen) goto badtlv;
+ ND_TCHECK_LEN(tptr, minlen); if (tlv_tlen < minlen) goto badtlv;
static int
ldp_tlv_print(netdissect_options *ndo,
switch (af) {
case AFNUM_INET:
while(tlv_tlen >= sizeof(struct in_addr)) {
- ND_TCHECK2(*tptr, sizeof(struct in_addr));
+ ND_TCHECK_LEN(tptr, sizeof(struct in_addr));
ND_PRINT((ndo, " %s", ipaddr_string(ndo, tptr)));
tlv_tlen-=sizeof(struct in_addr);
tptr+=sizeof(struct in_addr);
break;
case AFNUM_INET6:
while(tlv_tlen >= sizeof(struct in6_addr)) {
- ND_TCHECK2(*tptr, sizeof(struct in6_addr));
+ ND_TCHECK_LEN(tptr, sizeof(struct in6_addr));
ND_PRINT((ndo, " %s", ip6addr_string(ndo, tptr)));
tlv_tlen-=sizeof(struct in6_addr);
tptr+=sizeof(struct in6_addr);
case LDP_TLV_FEC:
TLV_TCHECK(1);
- fec_type = *tptr;
+ fec_type = EXTRACT_U_1(tptr);
ND_PRINT((ndo, "\n\t %s FEC (0x%02x)",
tok2str(ldp_fec_values, "Unknown", fec_type),
fec_type));
TLV_TCHECK(vc_info_len);
while (vc_info_len > 2) {
- vc_info_tlv_type = *tptr;
+ vc_info_tlv_type = EXTRACT_U_1(tptr);
vc_info_tlv_len = EXTRACT_U_1(tptr + 1);
if (vc_info_tlv_len < 2)
break;
while(tlen>0) {
/* did we capture enough for fully decoding the msg header ? */
- ND_TCHECK2(*tptr, sizeof(struct ldp_msg_header));
+ ND_TCHECK_LEN(tptr, sizeof(struct ldp_msg_header));
ldp_msg_header = (const struct ldp_msg_header *)tptr;
msg_len=EXTRACT_BE_U_2(ldp_msg_header->length);
msg_tlen=msg_len-(sizeof(struct ldp_msg_header)-4); /* Type & Length fields not included */
/* did we capture enough for fully decoding the message ? */
- ND_TCHECK2(*tptr, msg_len);
+ ND_TCHECK_LEN(tptr, msg_len);
hexdump=FALSE;
switch(msg_type) {