]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Check remote peer HT Operation element
authorMasashi Honma <masashi.honma@gmail.com>
Fri, 27 Jan 2017 04:43:19 +0000 (13:43 +0900)
committerJouni Malinen <j@w1.fi>
Sun, 29 Jan 2017 16:04:21 +0000 (18:04 +0200)
The remote mesh STA which had configuration disable_ht40=1 could have HT
Capabilities element which includes Supported Channel Width Set = 1
(both 20 MHz and 40 MHz operation is supported) even though it had HT
Operation element which includes STA Channel Width = 0 (20 MHz channel
width only). Previously, local peer recognized such a remote peer as 40
MHz band width enabled STA because local peer only checked HT
Capabilities element. This could cause disconnection between
disable_ht40=1 mesh STA and disable_ht40=0 mesh STA. They could
establish a mesh BSS but could not ping with ath9k_htc device. This
commit fixes the issue by refering HT Operation element.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
wpa_supplicant/mesh_mpm.c

index 6c3fa14c8d591e72cca20f156d2e259b35807097..1a0fd5f47eef93c09615208b9cef41b6db6a7c42 100644 (file)
@@ -11,6 +11,7 @@
 #include "utils/common.h"
 #include "utils/eloop.h"
 #include "common/ieee802_11_defs.h"
+#include "common/hw_features_common.h"
 #include "ap/hostapd.h"
 #include "ap/sta_info.h"
 #include "ap/ieee802_11.h"
@@ -646,6 +647,9 @@ static struct sta_info * mesh_mpm_add_peer(struct wpa_supplicant *wpa_s,
        struct mesh_conf *conf = wpa_s->ifmsh->mconf;
        struct hostapd_data *data = wpa_s->ifmsh->bss[0];
        struct sta_info *sta;
+#ifdef CONFIG_IEEE80211N
+       struct ieee80211_ht_operation *oper;
+#endif /* CONFIG_IEEE80211N */
        int ret;
 
        if (elems->mesh_config_len >= 7 &&
@@ -677,6 +681,16 @@ static struct sta_info * mesh_mpm_add_peer(struct wpa_supplicant *wpa_s,
 
 #ifdef CONFIG_IEEE80211N
        copy_sta_ht_capab(data, sta, elems->ht_capabilities);
+
+       oper = (struct ieee80211_ht_operation *) elems->ht_operation;
+       if (oper &&
+           !(oper->ht_param & HT_INFO_HT_PARAM_STA_CHNL_WIDTH)) {
+               wpa_msg(wpa_s, MSG_DEBUG, MACSTR
+                       " does not support 40 MHz bandwidth",
+                       MAC2STR(sta->addr));
+               set_disable_ht40(sta->ht_capabilities, 1);
+       }
+
        update_ht_state(data, sta);
 #endif /* CONFIG_IEEE80211N */