mesh: Use a separate variable to track whether HT is enabled

A network profile parameter should not be used to check whether the
currently operating mesh has HT enabled.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-01-10 12:52:50 +02:00
parent 1fc4ab2367
commit 6334330ed6
3 changed files with 4 additions and 4 deletions

View file

@ -319,6 +319,7 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
params.meshid = ssid->ssid; params.meshid = ssid->ssid;
params.meshid_len = ssid->ssid_len; params.meshid_len = ssid->ssid_len;
params.freq = ssid->frequency; params.freq = ssid->frequency;
wpa_s->mesh_ht_enabled = ssid->mesh_ht_mode > CHAN_NO_HT;
if (ssid->beacon_int > 0) if (ssid->beacon_int > 0)
params.beacon_int = ssid->beacon_int; params.beacon_int = ssid->beacon_int;
else if (wpa_s->conf->beacon_int > 0) else if (wpa_s->conf->beacon_int > 0)

View file

@ -229,8 +229,7 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s,
2 + 96 + /* AMPE */ 2 + 96 + /* AMPE */
2 + 16; /* MIC */ 2 + 16; /* MIC */
#ifdef CONFIG_IEEE80211N #ifdef CONFIG_IEEE80211N
if (type != PLINK_CLOSE && if (type != PLINK_CLOSE && wpa_s->mesh_ht_enabled) {
wpa_s->current_ssid->mesh_ht_mode > CHAN_NO_HT) {
buf_len += 2 + 26 + /* HT capabilities */ buf_len += 2 + 26 + /* HT capabilities */
2 + 22; /* HT operation */ 2 + 22; /* HT operation */
} }
@ -323,8 +322,7 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s,
} }
#ifdef CONFIG_IEEE80211N #ifdef CONFIG_IEEE80211N
if (type != PLINK_CLOSE && if (type != PLINK_CLOSE && wpa_s->mesh_ht_enabled) {
wpa_s->current_ssid->mesh_ht_mode > CHAN_NO_HT) {
pos = hostapd_eid_ht_capabilities(bss, ht_capa_oper); pos = hostapd_eid_ht_capabilities(bss, ht_capa_oper);
pos = hostapd_eid_ht_operation(bss, pos); pos = hostapd_eid_ht_operation(bss, pos);
wpabuf_put_data(buf, ht_capa_oper, pos - ht_capa_oper); wpabuf_put_data(buf, ht_capa_oper, pos - ht_capa_oper);

View file

@ -703,6 +703,7 @@ struct wpa_supplicant {
struct mesh_rsn *mesh_rsn; struct mesh_rsn *mesh_rsn;
int mesh_if_idx; int mesh_if_idx;
unsigned int mesh_if_created:1; unsigned int mesh_if_created:1;
unsigned int mesh_ht_enabled:1;
#endif /* CONFIG_MESH */ #endif /* CONFIG_MESH */
unsigned int off_channel_freq; unsigned int off_channel_freq;