]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update the Extended Capability element to struct sta_info
authorChaoli Zhou <quic_zchaoli@quicinc.com>
Tue, 22 Mar 2022 09:53:21 +0000 (11:53 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 23 Mar 2022 22:56:53 +0000 (00:56 +0200)
Only the SME-in-hostapd case updated sta->ext_capability while the
SME-in-the-driver case updated sta->qos_map_enabled, but not other items
related to the extended capabilities. This resulted in reduced
information being available through the control interface.

Use the shared helper function for both cases to get matching
information available regardless of the SME architecture.

Signed-off-by: Chaoli Zhou <quic_zchaoli@quicinc.com>
src/ap/drv_callbacks.c
src/ap/ieee802_11.c
src/ap/ieee802_11.h
src/ap/ieee802_11_shared.c

index d97b3535b003a60d6928bd212389fa91d01c7bde..54d0d517064e9fb72310e4eabece04ed3382f0f2 100644 (file)
@@ -261,12 +261,7 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
        }
 #endif /* NEED_AP_MLME */
 
-#ifdef CONFIG_INTERWORKING
-       if (elems.ext_capab && elems.ext_capab_len > 4) {
-               if (elems.ext_capab[4] & 0x01)
-                       sta->qos_map_enabled = 1;
-       }
-#endif /* CONFIG_INTERWORKING */
+       check_ext_capab(hapd, sta, elems.ext_capab, elems.ext_capab_len);
 
 #ifdef CONFIG_HS20
        wpabuf_free(sta->hs20_ie);
index bcefe57ed014fccd510d85694487d42f87bd2526..147b0a67053338fd38f33a244702f07b86948447 100644 (file)
@@ -4133,32 +4133,6 @@ static u16 copy_supp_rates(struct hostapd_data *hapd, struct sta_info *sta,
 }
 
 
-static u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
-                          const u8 *ext_capab_ie, size_t ext_capab_ie_len)
-{
-#ifdef CONFIG_INTERWORKING
-       /* check for QoS Map support */
-       if (ext_capab_ie_len >= 5) {
-               if (ext_capab_ie[4] & 0x01)
-                       sta->qos_map_enabled = 1;
-       }
-#endif /* CONFIG_INTERWORKING */
-
-       if (ext_capab_ie_len > 0) {
-               sta->ecsa_supported = !!(ext_capab_ie[0] & BIT(2));
-               os_free(sta->ext_capability);
-               sta->ext_capability = os_malloc(1 + ext_capab_ie_len);
-               if (sta->ext_capability) {
-                       sta->ext_capability[0] = ext_capab_ie_len;
-                       os_memcpy(sta->ext_capability + 1, ext_capab_ie,
-                                 ext_capab_ie_len);
-               }
-       }
-
-       return WLAN_STATUS_SUCCESS;
-}
-
-
 #ifdef CONFIG_OWE
 
 static int owe_group_supported(struct hostapd_data *hapd, u16 group)
index c59ad5e38e920210bdcb47d755e7873fce60a0f2..923cd520b281c9c4f3dcaa77593f1b97a6154cba 100644 (file)
@@ -194,6 +194,8 @@ int get_tx_parameters(struct sta_info *sta, int ap_max_chanwidth,
 
 void auth_sae_process_commit(void *eloop_ctx, void *user_ctx);
 u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len);
+u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
+                   const u8 *ext_capab_ie, size_t ext_capab_ie_len);
 size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type);
 u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type);
 
index 4bff9e5918832f917e356f80d840f24171f71266..615489511a2a2756a89fbf2f207e682118589962 100644 (file)
@@ -1093,3 +1093,29 @@ u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len)
 
        return pos;
 }
+
+
+u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
+                   const u8 *ext_capab_ie, size_t ext_capab_ie_len)
+{
+#ifdef CONFIG_INTERWORKING
+       /* check for QoS Map support */
+       if (ext_capab_ie_len >= 5) {
+               if (ext_capab_ie[4] & 0x01)
+                       sta->qos_map_enabled = 1;
+       }
+#endif /* CONFIG_INTERWORKING */
+
+       if (ext_capab_ie_len > 0) {
+               sta->ecsa_supported = !!(ext_capab_ie[0] & BIT(2));
+               os_free(sta->ext_capability);
+               sta->ext_capability = os_malloc(1 + ext_capab_ie_len);
+               if (sta->ext_capability) {
+                       sta->ext_capability[0] = ext_capab_ie_len;
+                       os_memcpy(sta->ext_capability + 1, ext_capab_ie,
+                                 ext_capab_ie_len);
+               }
+       }
+
+       return WLAN_STATUS_SUCCESS;
+}