diff options
-rw-r--r-- | net/mac80211/Kconfig | 12 | ||||
-rw-r--r-- | net/mac80211/rx.c | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 09c255002e56..e77592d050ce 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
@@ -98,6 +98,18 @@ config MAC80211_DEBUGFS | |||
98 | 98 | ||
99 | Say N unless you know you need this. | 99 | Say N unless you know you need this. |
100 | 100 | ||
101 | config MAC80211_DEBUG_PACKET_ALIGNMENT | ||
102 | bool "Enable packet alignment debugging" | ||
103 | depends on MAC80211 | ||
104 | help | ||
105 | This option is recommended for driver authors and strongly | ||
106 | discouraged for everybody else, it will trigger a warning | ||
107 | when a driver hands mac80211 a buffer that is aligned in | ||
108 | a way that will cause problems with the IP stack on some | ||
109 | architectures. | ||
110 | |||
111 | Say N unless you're writing a mac80211 based driver. | ||
112 | |||
101 | config MAC80211_DEBUG | 113 | config MAC80211_DEBUG |
102 | bool "Enable debugging output" | 114 | bool "Enable debugging output" |
103 | depends on MAC80211 | 115 | depends on MAC80211 |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index d44c87269bcb..535407d07fa4 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -340,11 +340,15 @@ static u32 ieee80211_rx_load_stats(struct ieee80211_local *local, | |||
340 | return load; | 340 | return load; |
341 | } | 341 | } |
342 | 342 | ||
343 | #ifdef CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT | ||
343 | static ieee80211_txrx_result | 344 | static ieee80211_txrx_result |
344 | ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx) | 345 | ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx) |
345 | { | 346 | { |
346 | int hdrlen; | 347 | int hdrlen; |
347 | 348 | ||
349 | if (!WLAN_FC_DATA_PRESENT(rx->fc)) | ||
350 | return TXRX_CONTINUE; | ||
351 | |||
348 | /* | 352 | /* |
349 | * Drivers are required to align the payload data in a way that | 353 | * Drivers are required to align the payload data in a way that |
350 | * guarantees that the contained IP header is aligned to a four- | 354 | * guarantees that the contained IP header is aligned to a four- |
@@ -371,11 +375,14 @@ ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx) | |||
371 | 375 | ||
372 | return TXRX_CONTINUE; | 376 | return TXRX_CONTINUE; |
373 | } | 377 | } |
378 | #endif | ||
374 | 379 | ||
375 | ieee80211_rx_handler ieee80211_rx_pre_handlers[] = | 380 | ieee80211_rx_handler ieee80211_rx_pre_handlers[] = |
376 | { | 381 | { |
377 | ieee80211_rx_h_parse_qos, | 382 | ieee80211_rx_h_parse_qos, |
383 | #ifdef CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT | ||
378 | ieee80211_rx_h_verify_ip_alignment, | 384 | ieee80211_rx_h_verify_ip_alignment, |
385 | #endif | ||
379 | NULL | 386 | NULL |
380 | }; | 387 | }; |
381 | 388 | ||