Fix non-HT STA addition

35463eaed3 broke non-HT STA add by trying
to se random HT capabilities to mac80211. Fix that by using NULL ht_cap
for non-HT case.
This commit is contained in:
Jouni Malinen 2009-03-05 11:25:32 +02:00 committed by Jouni Malinen
parent f72750896c
commit 37d8922e58

View File

@ -1562,7 +1562,10 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
u16 status;
struct sta_info *sta;
int new_assoc = 1;
#ifdef CONFIG_IEEE80211N
struct ht_cap_ie ht_cap;
#endif /* CONFIG_IEEE80211N */
struct ht_cap_ie *ht_cap_ptr = NULL;
if (!ok) {
hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
@ -1612,8 +1615,10 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
mlme_associate_indication(hapd, sta);
#ifdef CONFIG_IEEE80211N
if (sta->flags & WLAN_STA_HT)
hostapd_get_ht_capab(hapd, &sta->ht_capabilities, &ht_cap);
if (sta->flags & WLAN_STA_HT) {
ht_cap_ptr = &ht_cap;
hostapd_get_ht_capab(hapd, &sta->ht_capabilities, ht_cap_ptr);
}
#endif /* CONFIG_IEEE80211N */
#ifdef CONFIG_IEEE80211W
@ -1623,7 +1628,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
if (hostapd_sta_add(hapd->conf->iface, hapd, sta->addr, sta->aid,
sta->capability, sta->supported_rates,
sta->supported_rates_len, 0, sta->listen_interval,
&ht_cap))
ht_cap_ptr))
{
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_NOTICE,