Fix non-HT STA addition
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 5 Mar 2009 09:25:32 +0000 (11:25 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 5 Mar 2009 09:25:32 +0000 (11:25 +0200)
35463eaed391107dbe4a2dcaeb43aaa20e227a1e 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.

hostapd/ieee802_11.c

index 8f18d75..83e4388 100644 (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,