diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-10-21 04:22:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-08 15:54:13 -0500 |
commit | 152c477aa3eb8046b35aa7cde2782230064041d8 (patch) | |
tree | b54ff13db4111d02210c1650d8c5f3ee53ca5a25 /net/mac80211 | |
parent | b83db862ffb871e3131e5d2160c741b288eea9aa (diff) |
mac80211: exit cooked monitor RX early if there are none
If there are no cooked monitor interfaces, there's
no point in building the radiotap RX header for the
frame and iterating the interface list.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/rx.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index b867bd55de7a..c74e542a26b0 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -2489,6 +2489,10 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, | |||
2489 | goto out_free_skb; | 2489 | goto out_free_skb; |
2490 | rx->flags |= IEEE80211_RX_CMNTR; | 2490 | rx->flags |= IEEE80211_RX_CMNTR; |
2491 | 2491 | ||
2492 | /* If there are no cooked monitor interfaces, just free the SKB */ | ||
2493 | if (!local->cooked_mntrs) | ||
2494 | goto out_free_skb; | ||
2495 | |||
2492 | if (skb_headroom(skb) < sizeof(*rthdr) && | 2496 | if (skb_headroom(skb) < sizeof(*rthdr) && |
2493 | pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC)) | 2497 | pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC)) |
2494 | goto out_free_skb; | 2498 | goto out_free_skb; |