]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't attempt to dissect the payload of a no-data frame.
authorguy <guy>
Sun, 22 Jul 2007 19:59:06 +0000 (19:59 +0000)
committerguy <guy>
Sun, 22 Jul 2007 19:59:06 +0000 (19:59 +0000)
ieee802_11.h
print-802_11.c

index c8d0f9e3bd1bb2593dbd5e2ee41f6cf8e03ea0f3..3bcda7d22ba1bdb89090c54e079e17d74da0e006 100644 (file)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.11 2005-11-13 12:07:25 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.12 2007-07-22 19:59:06 guy Exp $ (LBL) */
 /*
  * Copyright (c) 2001
  *     Fortress Technologies
 #define        CTRL_CF_END     0xE
 #define        CTRL_END_ACK    0xF
 
-#define        DATA_DATA               0x0
-#define        DATA_DATA_CF_ACK        0x1
-#define        DATA_DATA_CF_POLL       0x2
-#define        DATA_DATA_CF_ACK_POLL   0x3
-#define        DATA_NODATA             0x4
-#define        DATA_NODATA_CF_ACK      0x5
-#define        DATA_NODATA_CF_POLL     0x6
-#define        DATA_NODATA_CF_ACK_POLL 0x7
+#define        DATA_DATA                       0x0
+#define        DATA_DATA_CF_ACK                0x1
+#define        DATA_DATA_CF_POLL               0x2
+#define        DATA_DATA_CF_ACK_POLL           0x3
+#define        DATA_NODATA                     0x4
+#define        DATA_NODATA_CF_ACK              0x5
+#define        DATA_NODATA_CF_POLL             0x6
+#define        DATA_NODATA_CF_ACK_POLL         0x7
+
+#define DATA_QOS_DATA                  0x8
+#define DATA_QOS_DATA_CF_ACK           0x9
+#define DATA_QOS_DATA_CF_POLL          0xA
+#define DATA_QOS_DATA_CF_ACK_POLL      0xB
+#define DATA_QOS_NODATA                        0xC
+#define DATA_QOS_CF_POLL_NODATA                0xE
+#define DATA_QOS_CF_ACK_POLL_NODATA    0xF
+
+/*
+ * The subtype field of a data frame is, in effect, composed of 4 flag
+ * bits - CF-Ack, CF-Poll, Null (means the frame doesn't actually have
+ * any data), and QoS.
+ */
+#define DATA_FRAME_IS_CF_ACK(x)                ((x) & 0x01)
+#define DATA_FRAME_IS_CF_POLL(x)       ((x) & 0x02)
+#define DATA_FRAME_IS_NULL(x)          ((x) & 0x04)
+#define DATA_FRAME_IS_QOS(x)           ((x) & 0x08)
 
 /*
  * Bits in the frame control field.
index 95161d7918a8a34c264b08a6a15ae3e553418935..cc2b9c97c805b07923ee17cf873c77b69cd328dd 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.44 2007-03-23 08:17:57 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.45 2007-07-22 19:59:06 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -945,6 +945,8 @@ ieee802_11_print(const u_char *p, u_int length, u_int caplen)
                }
                break;
        case T_DATA:
+               if (DATA_FRAME_IS_NULL(FC_SUBTYPE(fc)))
+                       return hdrlen;  /* no-data frame */
                /* There may be a problem w/ AP not having this bit set */
                if (FC_WEP(fc)) {
                        if (!wep_print(p)) {