summaryrefslogtreecommitdiff
path: root/print-dhcp6.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-26 13:02:48 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-11-26 15:44:43 +0100
commit1a90fd99d279d63242419a30ba3e0720872bff75 (patch)
treeb8b631a40f376875b5458bd1ec23d8775c0d266d /print-dhcp6.c
parent575188b5bf4fc1c26a2766319fcb7ca57d393868 (diff)
downloadtcpdump-1a90fd99d279d63242419a30ba3e0720872bff75.tar.gz
Use more the EXTRACT_U_1() macro (28/n)
In ND_PRINT() macro call(s) (step 7). p[n] ...
Diffstat (limited to 'print-dhcp6.c')
-rw-r--r--print-dhcp6.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/print-dhcp6.c b/print-dhcp6.c
index 2894ea8d..e6986da0 100644
--- a/print-dhcp6.c
+++ b/print-dhcp6.c
@@ -325,7 +325,7 @@ dhcp6opt_print(netdissect_options *ndo,
EXTRACT_BE_U_2(tp + 2),
EXTRACT_BE_U_4(tp + 4)));
for (i = 8; i < optlen; i++)
- ND_PRINT((ndo, "%02x", tp[i]));
+ ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i)));
/*(*/
ND_PRINT((ndo, ")"));
} else {
@@ -337,7 +337,7 @@ dhcp6opt_print(netdissect_options *ndo,
if (optlen >= 2 + 8) {
ND_PRINT((ndo, " vid "));
for (i = 2; i < 2 + 8; i++)
- ND_PRINT((ndo, "%02x", tp[i]));
+ ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i)));
/*(*/
ND_PRINT((ndo, ")"));
} else {
@@ -350,7 +350,7 @@ dhcp6opt_print(netdissect_options *ndo,
ND_PRINT((ndo, " hwaddr type %u ",
EXTRACT_BE_U_2(tp + 2)));
for (i = 4; i < optlen; i++)
- ND_PRINT((ndo, "%02x", tp[i]));
+ ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i)));
/*(*/
ND_PRINT((ndo, ")"));
} else {
@@ -521,7 +521,7 @@ dhcp6opt_print(netdissect_options *ndo,
tp = (const u_char *)(dh6o + 1);
ND_PRINT((ndo, " "));
for (i = 0; i < optlen && i < 10; i++)
- ND_PRINT((ndo, "%02x", tp[i]));
+ ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i)));
ND_PRINT((ndo, "...)"));
break;
case DH6OPT_RECONF_MSG:
@@ -617,7 +617,7 @@ dhcp6opt_print(netdissect_options *ndo,
break;
}
tp = (const u_char *)(dh6o + 1);
- ND_PRINT((ndo, " %s/%d", ip6addr_string(ndo, tp + 9), tp[8]));
+ ND_PRINT((ndo, " %s/%d", ip6addr_string(ndo, tp + 9), EXTRACT_U_1(tp + 8)));
ND_PRINT((ndo, " pltime:%u vltime:%u",
EXTRACT_BE_U_4(tp),
EXTRACT_BE_U_4(tp + 4)));
@@ -647,7 +647,7 @@ dhcp6opt_print(netdissect_options *ndo,
* Print hex dump first 10 characters.
*/
for (i = 4; i < optlen && i < 14; i++)
- ND_PRINT((ndo, "%02x", tp[i]));
+ ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i)));
ND_PRINT((ndo, "...)"));
break;
case DH6OPT_LQ_QUERY:
@@ -694,7 +694,7 @@ dhcp6opt_print(netdissect_options *ndo,
* Print hex dump first 10 characters.
*/
for (i = 16; i < optlen && i < 26; i++)
- ND_PRINT((ndo, "%02x", tp[i]));
+ ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i)));
ND_PRINT((ndo, "...)"));
break;
case DH6OPT_NTP_SERVER: