From: Johannes Berg Date: Tue, 6 Dec 2011 09:39:40 +0000 (+0100) Subject: mac80211: accept public action frames with mismatched BSSID X-Git-Tag: 1.9.5~5 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=3d744935c5ad5735c5a5ea0486e0c6389aa2c94f;p=carl9170fw.git mac80211: accept public action frames with mismatched BSSID Arik's patch "mac80211: allow action frames with unknown BSSID in GO mode" allowed any action frames in P2P mode to go through, but only to cooked monitor interfaces as the IEEE80211_RX_RA_MATCH was still cleared. As a result my no-monitor patches broke invitation responses. Instead of allowing any action frames in P2P GO mode to go through with a wrong BSSID like that patch did, allow all public action frames. They will never be processed by mac80211, but can be reported via nl80211 then. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville Signed-off-by: Christian Lamparter --- diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index d2d4435..6729ad0 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -1724,6 +1724,23 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr) return false; } +/** + * ieee80211_is_public_action - check if frame is a public action frame + * @hdr: the frame + * @len: length of the frame + */ +static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr, + size_t len) +{ + struct ieee80211_mgmt *mgmt = (void *)hdr; + + if (len < IEEE80211_MIN_ACTION_SIZE) + return false; + if (!ieee80211_is_action(hdr->frame_control)) + return false; + return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC; +} + /** * ieee80211_fhss_chan_to_freq - get channel frequency * @channel: the FHSS channel