Skip to contentSkip to conversation

mac80211: exit cooked monitor RX early if there are none

PATCH Superseded Johannes Berg 1 participant 2 messages Oct 21, 2011 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: exit cooked monitor RX early if there are none

From: Johannes Berg <[email protected]>

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.

---
 net/mac80211/rx.c |    4 ++++
 1 file changed, 4 insertions(+)
net/mac80211/rx.c +4 -0
@@ -2496,6 +2496,10 @@ static void ieee80211_rx_cooked_monitor(
 		goto out_free_skb;
 	rx->flags |= IEEE80211_RX_CMNTR;
 
+	/* If there are no cooked monitor interfaces, just free the SKB */
+	if (!local->>cooked_mntrs)
+		goto out_free_skb;
+
 	if (skb_headroom(skb) < sizeof(*rthdr) &&
 	    pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC))
 		goto out_free_skb;
author maintainer
#1 lore raw

PATCH v2 1/1 mac80211: exit cooked monitor RX early if there are none

From: Johannes Berg <[email protected]>

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.

---
v2: wow, embarrassing ... try quilt refresh ...

 net/mac80211/rx.c |    4 ++++
 1 file changed, 4 insertions(+)
net/mac80211/rx.c +4 -0
@@ -2489,6 +2489,10 @@ static void ieee80211_rx_cooked_monitor(
 		goto out_free_skb;
 	rx->flags |= IEEE80211_RX_CMNTR;
 
+	/* If there are no cooked monitor interfaces, just free the SKB */
+	if (!local->cooked_mntrs)
+		goto out_free_skb;
+
 	if (skb_headroom(skb) < sizeof(*rthdr) &&
 	    pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC))
 		goto out_free_skb;