Fix WMM and MFP STA flag setting with flags_or/flags_and

These were included correctly in total_flags, but not in
flags_or/flags_and.
This commit is contained in:
Jouni Malinen 2009-05-11 13:49:57 +03:00 committed by Jouni Malinen
parent c4e281fd91
commit eddd8010e6

View file

@ -1615,6 +1615,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
struct ht_cap_ie ht_cap; struct ht_cap_ie ht_cap;
#endif /* CONFIG_IEEE80211N */ #endif /* CONFIG_IEEE80211N */
struct ht_cap_ie *ht_cap_ptr = NULL; struct ht_cap_ie *ht_cap_ptr = NULL;
int set_flags, flags_and, flags_or;
if (!ok) { if (!ok) {
hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211, hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
@ -1699,13 +1700,12 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
/* VLAN ID already set (e.g., by PMKSA caching), so bind STA */ /* VLAN ID already set (e.g., by PMKSA caching), so bind STA */
ap_sta_bind_vlan(hapd, sta, 0); ap_sta_bind_vlan(hapd, sta, 0);
} }
if (sta->flags & WLAN_STA_SHORT_PREAMBLE) {
hostapd_sta_set_flags(hapd, sta->addr, sta->flags, set_flags = WLAN_STA_SHORT_PREAMBLE | WLAN_STA_WMM | WLAN_STA_MFP;
WLAN_STA_SHORT_PREAMBLE, ~0); flags_or = sta->flags & set_flags;
} else { flags_and = sta->flags | ~set_flags;
hostapd_sta_set_flags(hapd, sta->addr, sta->flags, hostapd_sta_set_flags(hapd, sta->addr, sta->flags,
0, ~WLAN_STA_SHORT_PREAMBLE); flags_or, flags_and);
}
if (sta->auth_alg == WLAN_AUTH_FT) if (sta->auth_alg == WLAN_AUTH_FT)
wpa_auth_sm_event(sta->wpa_sm, WPA_ASSOC_FT); wpa_auth_sm_event(sta->wpa_sm, WPA_ASSOC_FT);