diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c index 80a86312f..66b00766c 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c @@ -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; } diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index dbecbfa07..792f0bc4b 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -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; } diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index c2f7040da..d4f00d1f9 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -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); } diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h index eeb721c5b..614d3f448 100644 --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h @@ -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;