Commit b777bdfc authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211: handle protected dual of public action

The code currently handles ECSA (extended channel switch
announcement) public action frames. Handle also their
protected dual, which actually is protected.
Reviewed-by: default avatarMiriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240612143037.db642feb8b2e.I184fa5c9bffb68099171701e403c2aa733f60fde@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 414e090b
...@@ -7429,6 +7429,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, ...@@ -7429,6 +7429,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
{ {
struct ieee80211_link_data *link = &sdata->deflink; struct ieee80211_link_data *link = &sdata->deflink;
struct ieee80211_rx_status *rx_status; struct ieee80211_rx_status *rx_status;
struct ieee802_11_elems *elems;
struct ieee80211_mgmt *mgmt; struct ieee80211_mgmt *mgmt;
u16 fc; u16 fc;
int ies_len; int ies_len;
...@@ -7472,9 +7473,8 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, ...@@ -7472,9 +7473,8 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
!ether_addr_equal(mgmt->bssid, sdata->vif.cfg.ap_addr)) !ether_addr_equal(mgmt->bssid, sdata->vif.cfg.ap_addr))
break; break;
if (mgmt->u.action.category == WLAN_CATEGORY_SPECTRUM_MGMT) { switch (mgmt->u.action.category) {
struct ieee802_11_elems *elems; case WLAN_CATEGORY_SPECTRUM_MGMT:
ies_len = skb->len - ies_len = skb->len -
offsetof(struct ieee80211_mgmt, offsetof(struct ieee80211_mgmt,
u.action.u.chan_switch.variable); u.action.u.chan_switch.variable);
...@@ -7498,9 +7498,9 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, ...@@ -7498,9 +7498,9 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
src); src);
} }
kfree(elems); kfree(elems);
} else if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) { break;
struct ieee802_11_elems *elems; case WLAN_CATEGORY_PUBLIC:
case WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION:
ies_len = skb->len - ies_len = skb->len -
offsetof(struct ieee80211_mgmt, offsetof(struct ieee80211_mgmt,
u.action.u.ext_chan_switch.variable); u.action.u.ext_chan_switch.variable);
...@@ -7517,8 +7517,13 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, ...@@ -7517,8 +7517,13 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
ies_len, true, NULL); ies_len, true, NULL);
if (elems && !elems->parse_error) { if (elems && !elems->parse_error) {
enum ieee80211_csa_source src = enum ieee80211_csa_source src;
IEEE80211_CSA_SOURCE_UNPROT_ACTION;
if (mgmt->u.action.category ==
WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION)
src = IEEE80211_CSA_SOURCE_PROT_ACTION;
else
src = IEEE80211_CSA_SOURCE_UNPROT_ACTION;
/* for the handling code pretend it was an IE */ /* for the handling code pretend it was an IE */
elems->ext_chansw_ie = elems->ext_chansw_ie =
...@@ -7532,6 +7537,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, ...@@ -7532,6 +7537,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
} }
kfree(elems); kfree(elems);
break;
} }
break; break;
} }
......
...@@ -3617,6 +3617,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) ...@@ -3617,6 +3617,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
break; break;
case WLAN_CATEGORY_PUBLIC: case WLAN_CATEGORY_PUBLIC:
case WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION:
if (len < IEEE80211_MIN_ACTION_SIZE + 1) if (len < IEEE80211_MIN_ACTION_SIZE + 1)
goto invalid; goto invalid;
if (sdata->vif.type != NL80211_IFTYPE_STATION) if (sdata->vif.type != NL80211_IFTYPE_STATION)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment