aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2012-12-05 08:36:12 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-12-05 10:54:59 -0500
commit751413eadc8f0c7691a6cbd40a913ef0ae6b2ce4 (patch)
tree480ad2d1fc32394eb1db576e768f1044e2f9392f /net
parentab9d6e4ffe192427ce9e93d4f927b0faaa8a941e (diff)
mac80211: skip radiotap space calculation if no monitor exists
The radiotap header length "needed_headroom" is only required if we're sending the skb to a monitor interface. Hence, move the calculation a bit later so the calculation can be skipped if no monitor interface is present. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/rx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index db343fa8033..e4ee3274899 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -378,9 +378,6 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
378 * the SKB because it has a bad FCS/PLCP checksum. 378 * the SKB because it has a bad FCS/PLCP checksum.
379 */ 379 */
380 380
381 /* room for the radiotap header based on driver features */
382 needed_headroom = ieee80211_rx_radiotap_space(local, status);
383
384 if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS) 381 if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS)
385 present_fcs_len = FCS_LEN; 382 present_fcs_len = FCS_LEN;
386 383
@@ -399,6 +396,9 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
399 return remove_monitor_info(local, origskb); 396 return remove_monitor_info(local, origskb);
400 } 397 }
401 398
399 /* room for the radiotap header based on driver features */
400 needed_headroom = ieee80211_rx_radiotap_space(local, status);
401
402 if (should_drop_frame(origskb, present_fcs_len)) { 402 if (should_drop_frame(origskb, present_fcs_len)) {
403 /* only need to expand headroom if necessary */ 403 /* only need to expand headroom if necessary */
404 skb = origskb; 404 skb = origskb;