summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Oreman2009-08-01 18:56:44 +0200
committerMichael Brown2009-08-09 01:12:04 +0200
commit0b3c88e03520ac2663a70b8365341b727b2e67a2 (patch)
tree4ac21c6bde08a191786cd9f5c3bbd060e4d91c14
parent[802.11] Set channels early on to avoid tuning to an undefined channel (diff)
downloadipxe-0b3c88e03520ac2663a70b8365341b727b2e67a2.tar.gz
ipxe-0b3c88e03520ac2663a70b8365341b727b2e67a2.tar.xz
ipxe-0b3c88e03520ac2663a70b8365341b727b2e67a2.zip
[802.11] Fix maximum packet length
Previously the maximum packet length was computed using an erroneous understanding of the role of the MIC field in TKIP-encrypted packets. The field is actually considered to be part of the MSDU (encrypted and fragmented data), not the MPDU (container for each encrypted fragment). As such its size does not contribute to cryptographic overhead outside the data field's size limitations. The net result is that the previous maximum packet length value was 4 bytes too long; fix it to the correct value of 2352. Signed-off-by: Michael Brown <mcb30@etherboot.org>
-rw-r--r--src/include/gpxe/ieee80211.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/include/gpxe/ieee80211.h b/src/include/gpxe/ieee80211.h
index e2d25191..0403f929 100644
--- a/src/include/gpxe/ieee80211.h
+++ b/src/include/gpxe/ieee80211.h
@@ -31,11 +31,19 @@ FILE_LICENCE(GPL2_OR_LATER);
/** Maximum cryptographic overhead before encrypted data */
#define IEEE80211_MAX_CRYPTO_HEADER 8
-/** Maximum cryptographic overhead after encrypted data */
-#define IEEE80211_MAX_CRYPTO_TRAILER 12
+/** Maximum cryptographic overhead after encrypted data
+ *
+ * This does not count the MIC in TKIP frames, since that is
+ * considered to be part of the MSDU and thus contributes to the size
+ * of the data field.
+ *
+ * It @e does count the MIC in CCMP frames, which is considered part
+ * of the MPDU (outside the data field).
+ */
+#define IEEE80211_MAX_CRYPTO_TRAILER 8
/** Total maximum cryptographic overhead */
-#define IEEE80211_MAX_CRYPTO_OVERHEAD 20
+#define IEEE80211_MAX_CRYPTO_OVERHEAD 16
/** Bytes of network-layer data that can go into a regular data frame */
#define IEEE80211_MAX_FRAME_DATA 2296
@@ -58,10 +66,10 @@ FILE_LICENCE(GPL2_OR_LATER);
/** Maximum combined frame length
*
- * The biggest frame will include 32 frame header bytes, 20 bytes of
+ * The biggest frame will include 32 frame header bytes, 16 bytes of
* crypto overhead, and 2304 data bytes.
*/
-#define IEEE80211_MAX_FRAME_LEN 2356
+#define IEEE80211_MAX_FRAME_LEN 2352
/** Maximum length of an ESSID */
#define IEEE80211_MAX_SSID_LEN 32