]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the EXTRACT_U_1() macro to fetch a one-byte value (25/n)
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 23 Nov 2017 18:41:23 +0000 (19:41 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 23 Nov 2017 19:23:59 +0000 (20:23 +0100)
In ND_PRINT() macro call (step 4).

(*p op1 e1) op2 e2

print-ip.c

index bffbd7f18ed64471eec2c8f2b1e59ed6f0745ed6..8e58299dd6006c62a8120578a3e250274a8d7bd8 100644 (file)
@@ -715,7 +715,7 @@ ipN_print(netdissect_options *ndo, register const u_char *bp, register u_int len
                ip6_print (ndo, bp, length);
                break;
        default:
                ip6_print (ndo, bp, length);
                break;
        default:
-               ND_PRINT((ndo, "unknown ip %d", (*bp & 0xF0) >> 4));
+               ND_PRINT((ndo, "unknown ip %d", (EXTRACT_U_1(bp) & 0xF0) >> 4));
                break;
        }
        return;
                break;
        }
        return;