]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Add extended capabilities into STA command
authorbhagavathi perumal s <bperumal@qti.qualcomm.com>
Fri, 6 Oct 2017 15:03:25 +0000 (20:33 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 30 Oct 2017 22:31:31 +0000 (00:31 +0200)
Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
src/ap/ctrl_iface_ap.c
src/ap/ieee802_11.c
src/ap/sta_info.c
src/ap/sta_info.h

index 80a86312fced90af9c095326f5915097c347eb2c..66b00766c8db894ba27d4fd0f80efdc4e08e210c 100644 (file)
@@ -254,6 +254,15 @@ static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
                        len += ret;
        }
 
+       if (sta->ext_capability &&
+           buflen - len > (unsigned) (11 + 2 * sta->ext_capability[0])) {
+               len += os_snprintf(buf + len, buflen - len, "ext_capab=");
+               len += wpa_snprintf_hex(buf + len, buflen - len,
+                                       sta->ext_capability + 1,
+                                       sta->ext_capability[0]);
+               len += os_snprintf(buf + len, buflen - len, "\n");
+       }
+
        return len;
 }
 
index dbecbfa072a3ab319df5a73a430bfb2b2ecd1c67..792f0bc4b60f0d96b96218dbac773609c316c2d9 100644 (file)
@@ -2123,8 +2123,16 @@ static u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
        }
 #endif /* CONFIG_INTERWORKING */
 
-       if (ext_capab_ie_len > 0)
+       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;
 }
index c2f7040daac7d27d5fcfe01ae85de39cca02006e..d4f00d1f9ae835e0cff169f614896503cb86c724 100644 (file)
@@ -359,6 +359,8 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
        crypto_ecdh_deinit(sta->owe_ecdh);
 #endif /* CONFIG_OWE */
 
+       os_free(sta->ext_capability);
+
        os_free(sta);
 }
 
index eeb721c5b06966b71fdd8e813effb3fec582acf1..614d3f448d20157f3f21979cd8e2e56d2f88c52d 100644 (file)
@@ -251,6 +251,8 @@ struct sta_info {
        u16 owe_group;
 #endif /* CONFIG_OWE */
 
+       u8 *ext_capability;
+
 #ifdef CONFIG_TESTING_OPTIONS
        enum wpa_alg last_tk_alg;
        int last_tk_key_idx;