summaryrefslogtreecommitdiff
path: root/print-nfs.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-17 09:28:50 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-17 09:30:00 +0100
commit9113e560eb6155072f059e6340f22d0a621a81e1 (patch)
tree94cc1e3e3fa4ec94afa770a90df6c19ad178275c /print-nfs.c
parent6a58ce3ad1f0fc8b1bfe3f74435649b4f72b6955 (diff)
downloadtcpdump-9113e560eb6155072f059e6340f22d0a621a81e1.tar.gz
NFS: Use more the EXTRACT_BE_U_4 macro
Diffstat (limited to 'print-nfs.c')
-rw-r--r--print-nfs.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/print-nfs.c b/print-nfs.c
index 4d657c01..04c98bec 100644
--- a/print-nfs.c
+++ b/print-nfs.c
@@ -717,7 +717,9 @@ nfsreq_noaddr_print(netdissect_options *ndo,
EXTRACT_BE_U_4(dp + 4),
EXTRACT_BE_U_8(dp)));
if (ndo->ndo_vflag)
- ND_PRINT((ndo, " verf %08x%08x", dp[2], dp[3]));
+ ND_PRINT((ndo, " verf %08x%08x",
+ EXTRACT_BE_U_4(dp + 2),
+ EXTRACT_BE_U_4(dp + 3)));
} else {
ND_TCHECK(dp[1]);
/*
@@ -746,7 +748,9 @@ nfsreq_noaddr_print(netdissect_options *ndo,
if (ndo->ndo_vflag) {
ND_TCHECK(dp[5]);
ND_PRINT((ndo, " max %u verf %08x%08x",
- EXTRACT_BE_U_4(dp + 5), dp[2], dp[3]));
+ EXTRACT_BE_U_4(dp + 5),
+ EXTRACT_BE_U_4(dp + 2),
+ EXTRACT_BE_U_4(dp + 3)));
}
return;
}
@@ -796,7 +800,7 @@ nfs_printfh(netdissect_options *ndo,
ND_PRINT((ndo, " fh["));
for (i=0; i<len; i++) {
- ND_PRINT((ndo, "%s%x", sep, dp[i]));
+ ND_PRINT((ndo, "%s%x", sep, EXTRACT_BE_U_4(dp + i)));
sep = ":";
}
ND_PRINT((ndo, "]"));
@@ -1233,7 +1237,7 @@ parserddires(netdissect_options *ndo,
ND_TCHECK(dp[2]);
ND_PRINT((ndo, " offset 0x%x size %d ",
EXTRACT_BE_U_4(dp), EXTRACT_BE_U_4(dp + 1)));
- if (dp[2] != 0)
+ if (EXTRACT_BE_U_4(dp + 2) != 0)
ND_PRINT((ndo, " eof"));
return (1);
@@ -1366,7 +1370,8 @@ parsev3rddirres(netdissect_options *ndo,
return dp;
if (ndo->ndo_vflag) {
ND_TCHECK(dp[1]);
- ND_PRINT((ndo, " verf %08x%08x", dp[0], dp[1]));
+ ND_PRINT((ndo, " verf %08x%08x",
+ EXTRACT_BE_U_4(dp), EXTRACT_BE_U_4(dp + 1)));
dp += 2;
}
return dp;