]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip.c
Use more the EXTRACT_U_1() macro (51/n)
[tcpdump] / print-ip.c
index 64599835f96a8f38068c3285c793992678a6efc7..0974fbad7641c7466d584744438da7a24d071e49 100644 (file)
@@ -107,7 +107,7 @@ ip_finddst(netdissect_options *ndo,
                int tt;
 
                ND_TCHECK_1(cp);
-               tt = *cp;
+               tt = EXTRACT_U_1(cp);
                if (tt == IPOPT_EOL)
                        break;
                else if (tt == IPOPT_NOP)
@@ -255,7 +255,7 @@ ip_optprint(netdissect_options *ndo,
                sep = ",";
 
                ND_TCHECK_1(cp);
-               option_code = *cp;
+               option_code = EXTRACT_U_1(cp);
 
                ND_PRINT((ndo, "%s",
                          tok2str(ip_option_values,"unknown %u",option_code)));
@@ -349,7 +349,7 @@ again:
                        ND_PRINT((ndo, "[|AH]"));
                        break;
                }
-               ipds->nh = *ipds->cp;
+               ipds->nh = EXTRACT_U_1(ipds->cp);
                ipds->advance = ah_print(ndo, ipds->cp);
                if (ipds->advance <= 0)
                        break;
@@ -707,7 +707,7 @@ ipN_print(netdissect_options *ndo, register const u_char *bp, register u_int len
        }
 
        ND_TCHECK_1(bp);
-       switch (*bp & 0xF0) {
+       switch (EXTRACT_U_1(bp) & 0xF0) {
        case 0x40:
                ip_print (ndo, bp, length);
                break;