Browse Source

Fix non-HT STA addition

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.
Jouni Malinen 16 years ago
parent
commit
37d8922e58
1 changed files with 8 additions and 3 deletions
  1. 8 3
      hostapd/ieee802_11.c

+ 8 - 3
hostapd/ieee802_11.c

@@ -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,