summaryrefslogtreecommitdiff
path: root/print-vjc.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-02 14:19:13 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-03 13:35:26 +0100
commit61c422a88caefe986c2bc0a7f2f3028f696fa5cd (patch)
tree2cad95b84bee697060ff33c4e649662b2d19624c /print-vjc.c
parenta5bb53dd7407207c012d901789d68e4b8a7054cf (diff)
downloadtcpdump-61c422a88caefe986c2bc0a7f2f3028f696fa5cd.tar.gz
Use more the EXTRACT_U_1() macro (43/n)
In: if (... p[n] ...) ...
Diffstat (limited to 'print-vjc.c')
-rw-r--r--print-vjc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/print-vjc.c b/print-vjc.c
index 597ba060..b5f88ab6 100644
--- a/print-vjc.c
+++ b/print-vjc.c
@@ -30,6 +30,7 @@
#include <netdissect-stdinc.h>
#include "netdissect.h"
+#include "extract.h"
#include "slcompress.h"
#include "ppp.h"
@@ -100,10 +101,10 @@ vjc_print(netdissect_options *ndo, register const u_char *bp, u_short proto _U_)
if (ndo->ndo_eflag)
ND_PRINT((ndo, "(vjc type=compressed TCP) "));
for (i = 0; i < 8; i++) {
- if (bp[1] & (0x80 >> i))
+ if (EXTRACT_U_1(bp + 1) & (0x80 >> i))
ND_PRINT((ndo, "%c", "?CI?SAWU"[i]));
}
- if (bp[1])
+ if (EXTRACT_U_1(bp + 1))
ND_PRINT((ndo, " "));
ND_PRINT((ndo, "C=0x%02x ", bp[2]));
ND_PRINT((ndo, "sum=0x%04x ", *(const u_short *)(bp + 3)));