Commit 58305854 authored by Johannes Berg's avatar Johannes Berg
Browse files

wifi: mac80211: fix check for unusable RX result



If we just check "result & RX_DROP_UNUSABLE", this really only works
by accident, because SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE got to
have the value 1, and SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR is 2.

Fix this to really check the entire subsys mask for the value, so it
doesn't matter what the subsystem value is.

Fixes: 7f4e0970 ("wifi: mac80211: report all unusable beacon frames")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e406f291
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -53,4 +53,7 @@ enum mac80211_drop_reason {
#undef DEF
};

#define RX_RES_IS_UNUSABLE(result)	\
	(((__force u32)(result) & SKB_DROP_REASON_SUBSYS_MASK) == ___RX_DROP_UNUSABLE)

#endif /* MAC80211_DROP_H */
+1 −1
Original line number Diff line number Diff line
@@ -2112,7 +2112,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
	/* either the frame has been decrypted or will be dropped */
	status->flag |= RX_FLAG_DECRYPTED;

	if (unlikely(ieee80211_is_beacon(fc) && (result & RX_DROP_UNUSABLE) &&
	if (unlikely(ieee80211_is_beacon(fc) && RX_RES_IS_UNUSABLE(result) &&
		     rx->sdata->dev))
		cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev,
					     skb->data, skb->len);