diff options
-rw-r--r-- | print-atm.c | 2 | ||||
-rw-r--r-- | print-babel.c | 2 | ||||
-rw-r--r-- | print-hncp.c | 2 | ||||
-rw-r--r-- | print-icmp6.c | 6 | ||||
-rw-r--r-- | print-ip.c | 2 | ||||
-rw-r--r-- | print-ip6opts.c | 4 | ||||
-rw-r--r-- | print-isakmp.c | 8 | ||||
-rw-r--r-- | print-mobility.c | 2 | ||||
-rw-r--r-- | print-sl.c | 2 | ||||
-rw-r--r-- | print-smb.c | 4 | ||||
-rw-r--r-- | print-zeromq.c | 2 | ||||
-rw-r--r-- | smbutil.c | 2 |
12 files changed, 19 insertions, 19 deletions
diff --git a/print-atm.c b/print-atm.c index 9c4adbc1..43f61fcd 100644 --- a/print-atm.c +++ b/print-atm.c @@ -350,7 +350,7 @@ sig_print(netdissect_options *ndo, uint32_t call_ref; ND_TCHECK(p[PROTO_POS]); - if (p[PROTO_POS] == Q2931) { + if (EXTRACT_U_1(p + PROTO_POS) == Q2931) { /* * protocol:Q.2931 for User to Network Interface * (UNI 3.1) signalling diff --git a/print-babel.c b/print-babel.c index 49fb81de..d571bc11 100644 --- a/print-babel.c +++ b/print-babel.c @@ -53,7 +53,7 @@ babel_print(netdissect_options *ndo, ND_TCHECK_4(cp); - if(cp[0] != 42) { + if(EXTRACT_U_1(cp) != 42) { ND_PRINT((ndo, " invalid header")); return; } else { diff --git a/print-hncp.c b/print-hncp.c index 559c7032..e459dc76 100644 --- a/print-hncp.c +++ b/print-hncp.c @@ -207,7 +207,7 @@ print_prefix(netdissect_options *ndo, const u_char *prefix, u_int max_length) int plenbytes; char buf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx::/128")]; - if (prefix[0] >= 96 && max_length >= IPV4_MAPPED_HEADING_LEN + 1 && + if (EXTRACT_U_1(prefix) >= 96 && max_length >= IPV4_MAPPED_HEADING_LEN + 1 && is_ipv4_mapped_address(prefix + 1)) { struct in_addr addr; u_int plen; diff --git a/print-icmp6.c b/print-icmp6.c index 4fc13898..df893567 100644 --- a/print-icmp6.c +++ b/print-icmp6.c @@ -1497,7 +1497,7 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len) if (EXTRACT_U_1(bp + 24) & 0x07) { ND_PRINT((ndo," robustness=%d", EXTRACT_U_1(bp + 24) & 0x07)); } - if (bp[25] < 128) { + if (EXTRACT_U_1(bp + 25) < 128) { qqi = bp[25]; } else { qqi = ((bp[25] & 0x0f) | 0x10) << (((bp[25] & 0x70) >> 4) + 3); @@ -1659,7 +1659,7 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp, case ICMP6_NI_SUBJ_FQDN: ND_PRINT((ndo,", subject=DNS name")); cp = (const u_char *)(ni6 + 1); - if (cp[0] == ep - cp - 1) { + if (EXTRACT_U_1(cp) == ep - cp - 1) { /* icmp-name-lookup-03, pascal string */ if (ndo->ndo_vflag) ND_PRINT((ndo,", 03 draft")); @@ -1757,7 +1757,7 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp, ND_PRINT((ndo,"DNS name")); cp = (const u_char *)(ni6 + 1) + 4; ND_TCHECK(cp[0]); - if (cp[0] == ep - cp - 1) { + if (EXTRACT_U_1(cp) == ep - cp - 1) { /* icmp-name-lookup-03, pascal string */ if (ndo->ndo_vflag) ND_PRINT((ndo,", 03 draft")); @@ -228,7 +228,7 @@ ip_printts(netdissect_options *ndo, done: ND_PRINT((ndo, "%s", ptr == len ? " ^ " : "")); - if (cp[3]>>4) + if (EXTRACT_U_1(cp + 3) >> 4) ND_PRINT((ndo, " [%d hops not recorded]} ", EXTRACT_U_1(cp + 3)>>4)); else ND_PRINT((ndo, "}")); diff --git a/print-ip6opts.c b/print-ip6opts.c index db0ddbc4..7ed8c013 100644 --- a/print-ip6opts.c +++ b/print-ip6opts.c @@ -48,7 +48,7 @@ ip6_sopt_print(netdissect_options *ndo, const u_char *bp, int len) int optlen; for (i = 0; i < len; i += optlen) { - if (bp[i] == IP6OPT_PAD1) + if (EXTRACT_U_1(bp + i) == IP6OPT_PAD1) optlen = 1; else { if (i + 1 < len) @@ -94,7 +94,7 @@ ip6_opt_print(netdissect_options *ndo, const u_char *bp, int len) if (len == 0) return; for (i = 0; i < len; i += optlen) { - if (bp[i] == IP6OPT_PAD1) + if (EXTRACT_U_1(bp + i) == IP6OPT_PAD1) optlen = 1; else { if (i + 1 < len) diff --git a/print-isakmp.c b/print-isakmp.c index e5563631..641ee734 100644 --- a/print-isakmp.c +++ b/print-isakmp.c @@ -919,7 +919,7 @@ ikev1_attrmap_print(netdissect_options *ndo, uint32_t t, v; ND_TCHECK(p[0]); - if (p[0] & 0x80) + if (EXTRACT_U_1(p) & 0x80) totlen = 4; else { ND_TCHECK_2(p + 2); @@ -937,7 +937,7 @@ ikev1_attrmap_print(netdissect_options *ndo, ND_PRINT((ndo,"type=%s ", map[t].type)); else ND_PRINT((ndo,"type=#%d ", t)); - if (p[0] & 0x80) { + if (EXTRACT_U_1(p) & 0x80) { ND_PRINT((ndo,"value=")); ND_TCHECK_2(p + 2); v = EXTRACT_BE_U_2(p + 2); @@ -970,7 +970,7 @@ ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep2) uint32_t t; ND_TCHECK(p[0]); - if (p[0] & 0x80) + if (EXTRACT_U_1(p) & 0x80) totlen = 4; else { ND_TCHECK_2(p + 2); @@ -985,7 +985,7 @@ ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep2) ND_PRINT((ndo,"(")); t = EXTRACT_BE_U_2(p) & 0x7fff; ND_PRINT((ndo,"type=#%d ", t)); - if (p[0] & 0x80) { + if (EXTRACT_U_1(p) & 0x80) { ND_PRINT((ndo,"value=")); t = p[2]; if (!rawprint(ndo, (const uint8_t *)(p + 2), 2)) { diff --git a/print-mobility.c b/print-mobility.c index d4a27b04..76964436 100644 --- a/print-mobility.c +++ b/print-mobility.c @@ -119,7 +119,7 @@ mobility_opt_print(netdissect_options *ndo, for (i = 0; i < len; i += optlen) { ND_TCHECK(bp[i]); - if (bp[i] == IP6MOPT_PAD1) + if (EXTRACT_U_1(bp + i) == IP6MOPT_PAD1) optlen = 1; else { if (i + 1 < len) { @@ -183,7 +183,7 @@ sliplink_print(netdissect_options *ndo, /* Direction is bogus, don't use it */ return; } - if (p[SLX_CHDR] & TYPE_COMPRESSED_TCP) { + if (EXTRACT_U_1(p + SLX_CHDR) & TYPE_COMPRESSED_TCP) { compressed_sl_print(ndo, p + SLX_CHDR, ip, length, dir); ND_PRINT((ndo, ": ")); diff --git a/print-smb.c b/print-smb.c index 2db94606..89f0fd6b 100644 --- a/print-smb.c +++ b/print-smb.c @@ -203,7 +203,7 @@ print_trans2(netdissect_options *ndo, ND_PRINT((ndo, "%s param_length=%d data_length=%d\n", fn->name, pcnt, dcnt)); if (request) { - if (words[0] == 8) { + if (EXTRACT_U_1(words) == 8) { smb_fdata(ndo, words + 1, "Trans2Secondary\nTotParam=[d]\nTotData=[d]\nParamCnt=[d]\nParamOff=[d]\nParamDisp=[d]\nDataCnt=[d]\nDataOff=[d]\nDataDisp=[d]\nHandle=[d]\n", maxbuf, unicodestr); @@ -493,7 +493,7 @@ print_lockingandx(netdissect_options *ndo, if (request) { f1 = "Com2=[w]\nOff2=[d]\nHandle=[d]\nLockType=[w]\nTimeOut=[D]\nUnlockCount=[d]\nLockCount=[d]\n"; ND_TCHECK(words[7]); - if (words[7] & 0x10) + if (EXTRACT_U_1(words + 7) & 0x10) f2 = "*Process=[d]\n[P2]Offset=[M]\nLength=[M]\n"; else f2 = "*Process=[d]\nOffset=[D]\nLength=[D]\n"; diff --git a/print-zeromq.c b/print-zeromq.c index 8d34fc6a..004750ba 100644 --- a/print-zeromq.c +++ b/print-zeromq.c @@ -82,7 +82,7 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) ND_PRINT((ndo, "\n\t")); ND_TCHECK_1(cp); /* length/0xFF */ - if (cp[0] != 0xFF) { + if (EXTRACT_U_1(cp) != 0xFF) { header_len = 1; /* length */ body_len_declared = cp[0]; ND_PRINT((ndo, " frame flags+body (8-bit) length %" PRIu64, body_len_declared)); @@ -410,7 +410,7 @@ unistr(netdissect_options *ndo, ND_TCHECK_2(s); if (l >= MAX_UNISTR_SIZE) break; - if (s[1] == 0 && ND_ISPRINT(EXTRACT_U_1(s))) { + if (EXTRACT_U_1(s + 1) == 0 && ND_ISPRINT(EXTRACT_U_1(s))) { /* It's a printable ASCII character */ buf[l] = s[0]; } else { |