]> The Tcpdump Group git mirrors - tcpdump/blobdiff - ip.h
Use more the ND_TTEST_1() macro
[tcpdump] / ip.h
diff --git a/ip.h b/ip.h
index 8179061ef13143a924ed8f72195cc956b6dfeed3..d2c83e057823a42db98d6cc366109b4d1c79de75 100644 (file)
--- a/ip.h
+++ b/ip.h
@@ -51,8 +51,8 @@
  */
 struct ip {
        nd_uint8_t      ip_vhl;         /* header length, version */
-#define IP_V(ip)       (((ip)->ip_vhl & 0xf0) >> 4)
-#define IP_HL(ip)      ((ip)->ip_vhl & 0x0f)
+#define IP_V(ip)       ((EXTRACT_U_1((ip)->ip_vhl) & 0xf0) >> 4)
+#define IP_HL(ip)      (EXTRACT_U_1((ip)->ip_vhl) & 0x0f)
        nd_uint8_t      ip_tos;         /* type of service */
        nd_uint16_t     ip_len;         /* total length */
        nd_uint16_t     ip_id;          /* identification */