summaryrefslogtreecommitdiff
path: root/print-hncp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-09 12:32:00 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-09 14:05:25 +0100
commit07ac438e08e5ffed3539e10d78f1cfc7d221d591 (patch)
tree8e07185c1f646ef08c85bbb7d9a075b32e65272f /print-hncp.c
parent1cfd6cd2ac8acecbcf16e083a6cd272a19ec994e (diff)
downloadtcpdump-07ac438e08e5ffed3539e10d78f1cfc7d221d591.tar.gz
Use more the EXTRACT_U_1() macro (52/n)
Assignment, p[n]
Diffstat (limited to 'print-hncp.c')
-rw-r--r--print-hncp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/print-hncp.c b/print-hncp.c
index e459dc76..a1341923 100644
--- a/print-hncp.c
+++ b/print-hncp.c
@@ -242,7 +242,8 @@ print_dns_label(netdissect_options *ndo,
{
u_int length = 0;
while (length < max_length) {
- u_int lab_length = cp[length++];
+ u_int lab_length = EXTRACT_U_1(cp + length);
+ length++;
if (lab_length == 0)
return (int)length;
if (length > 1 && print)
@@ -274,8 +275,8 @@ dhcpv4_print(netdissect_options *ndo,
if (i + 2 > length)
return -1;
tlv = cp + i;
- type = tlv[0];
- optlen = tlv[1];
+ type = EXTRACT_U_1(tlv);
+ optlen = EXTRACT_U_1(tlv + 1);
value = tlv + 2;
ND_PRINT((ndo, "\n"));
@@ -654,7 +655,7 @@ hncp_print_rec(netdissect_options *ndo,
ND_PRINT((ndo, " %s", istr));
break;
}
- policy = value[0];
+ policy = EXTRACT_U_1(value);
ND_PRINT((ndo, " type: "));
if (policy == 0) {
if (bodylen != 1) {
@@ -807,7 +808,7 @@ hncp_print_rec(netdissect_options *ndo,
ND_PRINT((ndo, " %s", istr));
break;
}
- l = value[16];
+ l = EXTRACT_U_1(value + 16);
if (bodylen < 17 + l) {
ND_PRINT((ndo, " %s", istr));
break;