]> 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 20:01:16 +0000 (20:01 +0000)
committerguy <guy>
Sun, 22 Jul 2007 20:01:16 +0000 (20:01 +0000)
ieee802_11.h
print-802_11.c

index 121b5d71848ba41b9724828de6c9cb44e1677ff0..a69c635dbb42229e256c6f7cad4db47c451aa52c 100644 (file)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.9.4.2 2005-11-13 12:07:44 guy Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.9.4.3 2007-07-22 20:01:16 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 40b58e4fa7059092e7d6b71eaf3e633a46cd75dc..b0408c405c62ecaef0ddd0ea2760357351e78b2a 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.31.2.12 2007-02-01 02:18:45 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.31.2.13 2007-07-22 20:01:16 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)) {