diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 1a4cc1a61..bdc2c0a8f 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -308,16 +308,17 @@ void handle_probe_req(struct hostapd_data *hapd, /* Extended supported rates */ pos = hostapd_eid_ext_supp_rates(hapd, pos); + /* RSN, MDIE, WPA */ pos = hostapd_eid_wpa(hapd, pos, epos - pos, sta); - /* Wi-Fi Alliance WMM */ - pos = hostapd_eid_wmm(hapd, pos); - #ifdef CONFIG_IEEE80211N pos = hostapd_eid_ht_capabilities(hapd, pos); pos = hostapd_eid_ht_operation(hapd, pos); #endif /* CONFIG_IEEE80211N */ + /* Wi-Fi Alliance WMM */ + pos = hostapd_eid_wmm(hapd, pos); + #ifdef CONFIG_WPS if (hapd->conf->wps_state && hapd->wps_probe_resp_ie) { os_memcpy(pos, wpabuf_head(hapd->wps_probe_resp_ie), @@ -408,17 +409,18 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd) /* Extended supported rates */ tailpos = hostapd_eid_ext_supp_rates(hapd, tailpos); + /* RSN, MDIE, WPA */ tailpos = hostapd_eid_wpa(hapd, tailpos, tail + BEACON_TAIL_BUF_SIZE - tailpos, NULL); - /* Wi-Fi Alliance WMM */ - tailpos = hostapd_eid_wmm(hapd, tailpos); - #ifdef CONFIG_IEEE80211N tailpos = hostapd_eid_ht_capabilities(hapd, tailpos); tailpos = hostapd_eid_ht_operation(hapd, tailpos); #endif /* CONFIG_IEEE80211N */ + /* Wi-Fi Alliance WMM */ + tailpos = hostapd_eid_wmm(hapd, tailpos); + #ifdef CONFIG_WPS if (hapd->conf->wps_state && hapd->wps_beacon_ie) { os_memcpy(tailpos, wpabuf_head(hapd->wps_beacon_ie), diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 6ce94b21c..02baddd4c 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -850,13 +850,6 @@ static void send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta, p = hostapd_eid_supp_rates(hapd, reply->u.assoc_resp.variable); /* Extended supported rates */ p = hostapd_eid_ext_supp_rates(hapd, p); - if (sta->flags & WLAN_STA_WMM) - p = hostapd_eid_wmm(hapd, p); - -#ifdef CONFIG_IEEE80211N - p = hostapd_eid_ht_capabilities(hapd, p); - p = hostapd_eid_ht_operation(hapd, p); -#endif /* CONFIG_IEEE80211N */ #ifdef CONFIG_IEEE80211R if (status_code == WLAN_STATUS_SUCCESS) { @@ -873,6 +866,14 @@ static void send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta, p = hostapd_eid_assoc_comeback_time(hapd, sta, p); #endif /* CONFIG_IEEE80211W */ +#ifdef CONFIG_IEEE80211N + p = hostapd_eid_ht_capabilities(hapd, p); + p = hostapd_eid_ht_operation(hapd, p); +#endif /* CONFIG_IEEE80211N */ + + if (sta->flags & WLAN_STA_WMM) + p = hostapd_eid_wmm(hapd, p); + send_len += p - reply->u.assoc_resp.variable; if (hapd->drv.send_mgmt_frame(hapd, reply, send_len) < 0)