]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the EXTRACT_U_1() macro (55/n)
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 10 Dec 2017 20:33:49 +0000 (21:33 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 10 Dec 2017 20:33:49 +0000 (21:33 +0100)
print-802_11.c
print-babel.c

index f86fafe9bec1f731e3e385cc21e1084297d84cd1..17e128d97f9c57a161fc6725986825cc371ed47e 100644 (file)
@@ -1953,7 +1953,7 @@ extract_header_length(netdissect_options *ndo,
 static int
 extract_mesh_header_length(const u_char *p)
 {
-       return (p[0] &~ 3) ? 0 : 6*(1 + (p[0] & 3));
+       return (EXTRACT_U_1(p) &~ 3) ? 0 : 6*(1 + (EXTRACT_U_1(p) & 3));
 }
 
 /*
index 10408e9f8676a5d0e2052d109d50d6377bf6ce4c..5d4c8cb55f983aaef8bd7cf0aa05b7007f524f0f 100644 (file)
@@ -519,7 +519,7 @@ babel_print_v2(netdissect_options *ndo,
                        format_prefix(ndo, prefix, plen),
                        metric, seqno, format_interval_update(interval)));
                 if(EXTRACT_U_1(message + 3) & 0x80) {
-                    if(message[2] == 1)
+                    if(EXTRACT_U_1(message + 2) == 1)
                         memcpy(v4_prefix, prefix, 16);
                     else
                         memcpy(v6_prefix, prefix, 16);