diff options
-rw-r--r-- | print-aoe.c | 2 | ||||
-rw-r--r-- | print-lldp.c | 2 | ||||
-rw-r--r-- | print-mpcp.c | 2 | ||||
-rw-r--r-- | print-ppp.c | 3 | ||||
-rw-r--r-- | print-snmp.c | 3 |
5 files changed, 7 insertions, 5 deletions
diff --git a/print-aoe.c b/print-aoe.c index c790ee2a..7dcf5aa2 100644 --- a/print-aoe.c +++ b/print-aoe.c @@ -350,7 +350,7 @@ aoev1_print(netdissect_options *ndo, if (len < AOEV1_COMMON_HDR_LEN) goto invalid; /* Flags */ - flags = *cp & 0x0F; + flags = EXTRACT_8BITS(cp) & 0x0F; ND_PRINT((ndo, ", Flags: [%s]", bittok2str(aoev1_flag_str, "none", flags))); cp += 1; if (! ndo->ndo_vflag) diff --git a/print-lldp.c b/print-lldp.c index f3441f25..fd016a2e 100644 --- a/print-lldp.c +++ b/print-lldp.c @@ -920,7 +920,7 @@ lldp_extract_latlon(const u_char *tptr) { uint64_t latlon; - latlon = *tptr & 0x3; + latlon = EXTRACT_8BITS(tptr) & 0x3; latlon = (latlon << 32) | EXTRACT_BE_32BITS(tptr + 1); return latlon; diff --git a/print-mpcp.c b/print-mpcp.c index 7d7a9755..d40d03da 100644 --- a/print-mpcp.c +++ b/print-mpcp.c @@ -159,7 +159,7 @@ mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int case MPCP_OPCODE_GATE: ND_TCHECK2(*tptr, MPCP_GRANT_NUMBER_LEN); - grant_numbers = *tptr & MPCP_GRANT_NUMBER_MASK; + grant_numbers = EXTRACT_8BITS(tptr) & MPCP_GRANT_NUMBER_MASK; ND_PRINT((ndo, "\n\tGrant Numbers %u, Flags [ %s ]", grant_numbers, bittok2str(mpcp_grant_flag_values, diff --git a/print-ppp.c b/print-ppp.c index 88e5792d..b6723f85 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -1395,7 +1395,8 @@ ppp_hdlc(netdissect_options *ndo, if (i <= 1 || !ND_TTEST(*s)) break; i--; - c = *s++ ^ 0x20; + c = EXTRACT_8BITS(s) ^ 0x20; + s++; } *t++ = c; } diff --git a/print-snmp.c b/print-snmp.c index 1b096dcf..dc6f1a6e 100644 --- a/print-snmp.c +++ b/print-snmp.c @@ -72,6 +72,7 @@ #endif #include "netdissect.h" +#include "extract.h" #undef OPAQUE /* defined in <wingdi.h> */ @@ -437,7 +438,7 @@ asn1_parse(netdissect_options *ndo, * +---+---+---+---+---+---+---+---+ * 7 6 5 4 3 2 1 0 */ - id = *p & ASN_ID_BITS; /* lower 5 bits, range 00-1f */ + id = EXTRACT_8BITS(p) & ASN_ID_BITS; /* lower 5 bits, range 00-1f */ #ifdef notdef form = (*p & 0xe0) >> 5; /* move upper 3 bits to lower 3 */ class = form >> 1; /* bits 7&6 -> bits 1&0, range 0-3 */ |