]> www.infradead.org Git - users/hch/configfs.git/commitdiff
wifi: mac80211: handle protected dual of public action
authorJohannes Berg <johannes.berg@intel.com>
Wed, 12 Jun 2024 12:28:37 +0000 (14:28 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 26 Jun 2024 08:21:48 +0000 (10:21 +0200)
The code currently handles ECSA (extended channel switch
announcement) public action frames. Handle also their
protected dual, which actually is protected.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240612143037.db642feb8b2e.I184fa5c9bffb68099171701e403c2aa733f60fde@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c
net/mac80211/rx.c

index fff158b1615f133c8b73a9c4d37b006058bdf480..e76b887a46eb57896fa0b8aeba358560a41e0afe 100644 (file)
@@ -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_rx_status *rx_status;
+       struct ieee802_11_elems *elems;
        struct ieee80211_mgmt *mgmt;
        u16 fc;
        int ies_len;
@@ -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))
                        break;
 
-               if (mgmt->u.action.category == WLAN_CATEGORY_SPECTRUM_MGMT) {
-                       struct ieee802_11_elems *elems;
-
+               switch (mgmt->u.action.category) {
+               case WLAN_CATEGORY_SPECTRUM_MGMT:
                        ies_len = skb->len -
                                  offsetof(struct ieee80211_mgmt,
                                           u.action.u.chan_switch.variable);
@@ -7498,9 +7498,9 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
                                                                 src);
                        }
                        kfree(elems);
-               } else if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) {
-                       struct ieee802_11_elems *elems;
-
+                       break;
+               case WLAN_CATEGORY_PUBLIC:
+               case WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION:
                        ies_len = skb->len -
                                  offsetof(struct ieee80211_mgmt,
                                           u.action.u.ext_chan_switch.variable);
@@ -7517,8 +7517,13 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
                                        ies_len, true, NULL);
 
                        if (elems && !elems->parse_error) {
-                               enum ieee80211_csa_source src =
-                                       IEEE80211_CSA_SOURCE_UNPROT_ACTION;
+                               enum ieee80211_csa_source src;
+
+                               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 */
                                elems->ext_chansw_ie =
@@ -7532,6 +7537,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
                        }
 
                        kfree(elems);
+                       break;
                }
                break;
        }
index 4914692750e5e8b5f891cebfed64c6c6e0fec247..0ff9062a130cb7cca648df3aa8ae2f3bc66647e6 100644 (file)
@@ -3617,6 +3617,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
 
                break;
        case WLAN_CATEGORY_PUBLIC:
+       case WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION:
                if (len < IEEE80211_MIN_ACTION_SIZE + 1)
                        goto invalid;
                if (sdata->vif.type != NL80211_IFTYPE_STATION)