ND_PRINT((ndo, "CDPv%u, ttl: %us", EXTRACT_U_1((tptr + CDP_HEADER_VERSION_OFFSET)),
EXTRACT_U_1(tptr + CDP_HEADER_TTL_OFFSET)));
if (ndo->ndo_vflag)
ND_PRINT((ndo, "CDPv%u, ttl: %us", EXTRACT_U_1((tptr + CDP_HEADER_VERSION_OFFSET)),
EXTRACT_U_1(tptr + CDP_HEADER_TTL_OFFSET)));
if (ndo->ndo_vflag)
type = EXTRACT_BE_U_2(tptr + CDP_TLV_TYPE_OFFSET);
len = EXTRACT_BE_U_2(tptr + CDP_TLV_LEN_OFFSET); /* object length includes the 4 bytes header length */
if (len < CDP_TLV_HEADER_LEN) {
type = EXTRACT_BE_U_2(tptr + CDP_TLV_TYPE_OFFSET);
len = EXTRACT_BE_U_2(tptr + CDP_TLV_LEN_OFFSET); /* object length includes the 4 bytes header length */
if (len < CDP_TLV_HEADER_LEN) {
- pt = p[0]; /* type of "protocol" field */
- pl = p[1]; /* length of "protocol" field */
+ pt = EXTRACT_U_1(p); /* type of "protocol" field */
+ pl = EXTRACT_U_1(p + 1); /* length of "protocol" field */
if (p + pl > endp)
goto trunc;
ND_PRINT((ndo, "pt=0x%02x, pl=%d, pb=", EXTRACT_U_1((p - 2)), pl));
if (p + pl > endp)
goto trunc;
ND_PRINT((ndo, "pt=0x%02x, pl=%d, pb=", EXTRACT_U_1((p - 2)), pl));
goto trunc;
ND_PRINT((ndo, ", al=%d, a=", al));
p += 2;
goto trunc;
ND_PRINT((ndo, ", al=%d, a=", al));
p += 2;