uint32_t t1, t2;
while (cp < ep) {
- subtype = *cp++;
+ subtype = EXTRACT_8BITS(cp);
+ cp++;
if(subtype == MESSAGE_SUB_PAD1) {
ND_PRINT((ndo, " sub-pad1"));
continue;
}
if(cp == ep)
goto invalid;
- sublen = *cp++;
+ sublen = EXTRACT_8BITS(cp);
+ cp++;
if(cp + sublen > ep)
goto invalid;
/* DNS name decoding - no decompression */
ND_PRINT((ndo,", \""));
while (cp < ep) {
- i = *cp++;
+ i = EXTRACT_8BITS(cp);
+ cp++;
if (i) {
if (i > ep - cp) {
ND_PRINT((ndo,"???"));
flag = 1;
while (s < ep) {
- c = *s++;
+ c = EXTRACT_8BITS(s);
+ s++;
if (c == '\0') {
flag = 0;
break;
if (tlen < 1) {
return 0;
}
- mgmt_addr_len = *tptr++;
+ mgmt_addr_len = EXTRACT_8BITS(tptr);
+ tptr++;
tlen--;
if (tlen < mgmt_addr_len) {
* That option header MUST be an OPT_LENGTH option
* (see the first paragraph of section 9.1 in RFC 3208).
*/
- opt_type = *bp++;
+ opt_type = EXTRACT_8BITS(bp);
+ bp++;
if ((opt_type & PGM_OPT_MASK) != PGM_OPT_LENGTH) {
ND_PRINT((ndo, "[First option bad, should be PGM_OPT_LENGTH, is %u]", opt_type & PGM_OPT_MASK));
return;
}
- opt_len = *bp++;
+ opt_len = EXTRACT_8BITS(bp);
+ bp++;
if (opt_len != 4) {
ND_PRINT((ndo, "[Bad OPT_LENGTH option, length %u != 4]", opt_len));
return;
ND_PRINT((ndo, " [|OPT]"));
return;
}
- opt_type = *bp++;
- opt_len = *bp++;
+ opt_type = EXTRACT_8BITS(bp);
+ bp++;
+ opt_len = EXTRACT_8BITS(bp);
+ bp++;
if (opt_len < PGM_MIN_OPT_LEN) {
ND_PRINT((ndo, "[Bad option, length %u < %u]", opt_len,
PGM_MIN_OPT_LEN));
goto trunc;
ND_TCHECK2(*tptr, 2);
- code = *tptr++;
+ code = EXTRACT_8BITS(tptr);
+ tptr++;
ND_PRINT((ndo, "%s (0x%02x), id %u, length %u",
tok2str(cpcodes, "Unknown Opcode",code),
* contents.
*/
for (s = p, t = b, i = length; i > 0 && ND_TTEST(*s); i--) {
- c = *s++;
+ c = EXTRACT_8BITS(s);
+ s++;
if (c == 0x7d) {
if (i <= 1 || !ND_TTEST(*s))
break;
register const u_char *cp = chdr;
register u_int flags, hlen;
- flags = *cp++;
+ flags = EXTRACT_8BITS(cp);
+ cp++;
if (flags & NEW_C) {
- lastconn = *cp++;
+ lastconn = EXTRACT_8BITS(cp);
+ cp++;
ND_PRINT((ndo, "ctcp %d", lastconn));
} else
ND_PRINT((ndo, "ctcp *"));
if (ch != '\0')
ND_PRINT((ndo, "%c", ch));
ND_TCHECK(*cp);
- opt = *cp++;
+ opt = EXTRACT_8BITS(cp);
+ cp++;
if (ZEROLENOPT(opt))
len = 1;
else {
ND_TCHECK(*cp);
- len = *cp++; /* total including type, len */
+ len = EXTRACT_8BITS(cp);
+ cp++; /* total including type, len */
if (len < 2 || len > hlen)
goto bad;
--hlen; /* account for length byte */
}
ND_PRINT((ndo, " "));
while (length-- && sp < ndo->ndo_snapend) {
- c = *sp++;
+ c = EXTRACT_8BITS(sp);
+ sp++;
safeputchar(ndo, c);
}
ND_PRINT((ndo, "]"));