}
length -= sizeof(*fixed_hdr);
if (mand_part_len > length)
- mand_part_len = length;
+ mand_part_len = (uint16_t)length;
/* We start looking at the mandatory header here. */
ND_TCHECK_LEN(bp, sizeof(*fixed_hdr));
ND_TCHECK_LEN(bp, sizeof(*mand_hdr));
mand_hdr = (const struct nhrp_mand_header *)bp;
-// nhrpext = p + extoff;
-// nhrpend = p + pktsz;
-
switch (op_type) {
case NHRP_PKT_RESOLUTION_REQUEST:
case NHRP_PKT_RESOLUTION_REPLY:
while (mand_part_len != 0) {
u_int cie_len;
+ /*
+ * cie_len is guaranteed by nhrp_print_cie()
+ * to be <= mand_part_len.
+ */
cie_len = nhrp_print_cie(ndo, bp, mand_part_len,
afn, pro_type);
bp += cie_len;
- mand_part_len -= cie_len;
+ mand_part_len -= (uint16_t)cie_len;
}
break;
case NHRP_PKT_ERROR_INDICATION: