Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc885189 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: don't check rates on PLCP error frames



Frames that failed PLCP error checks are most likely
microwave transmissions (well, maybe not ...) and
don't have a proper rate detected, so ignore it.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 86df5f72
Loading
Loading
Loading
Loading
+29 −20
Original line number Diff line number Diff line
@@ -2615,14 +2615,22 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
	if (WARN_ON(!local->started))
		goto drop;

	if (likely(!(status->flag & RX_FLAG_FAILED_PLCP_CRC))) {
		/*
		 * Validate the rate, unless a PLCP error means that
		 * we probably can't have a valid rate here anyway.
		 */

		if (status->flag & RX_FLAG_HT) {
			/*
		 * rate_idx is MCS index, which can be [0-76] as documented on:
			 * rate_idx is MCS index, which can be [0-76]
			 * as documented on:
			 *
			 * http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n
			 *
		 * Anything else would be some sort of driver or hardware error.
		 * The driver should catch hardware errors.
			 * Anything else would be some sort of driver or
			 * hardware error. The driver should catch hardware
			 * errors.
			 */
			if (WARN((status->rate_idx < 0 ||
				 status->rate_idx > 76),
@@ -2638,6 +2646,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
				goto drop;
			rate = &sband->bitrates[status->rate_idx];
		}
	}

	/*
	 * key references and virtual interfaces are protected using RCU