aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/config.c
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2014-09-01 04:23:38 (GMT)
committerJouni Malinen <j@w1.fi>2014-11-16 17:43:11 (GMT)
commit2b2bb5a8b987f3921f32dd9e76c351496ce6ff15 (patch)
tree76debbeb769a89a4bd5105a7c04ef94b7601591f /wpa_supplicant/config.c
parent603a3f34c44cbcd9f843ed18b5accaf9540d6755 (diff)
downloadhostap-2b2bb5a8b987f3921f32dd9e76c351496ce6ff15.zip
hostap-2b2bb5a8b987f3921f32dd9e76c351496ce6ff15.tar.gz
hostap-2b2bb5a8b987f3921f32dd9e76c351496ce6ff15.tar.bz2
mesh: Make BSSBasicRateSet configurable
STAs that have different BSSBasicRateSet cannot connect to each other as per IEEE 802.11s-2011 9.6.0c1: "A mesh STA shall not establish a mesh peering with a mesh STA using a different BSSBasicRateSet." Make BSSBasicRateSet configurable to improve interoperability with other stations. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Diffstat (limited to 'wpa_supplicant/config.c')
-rw-r--r--wpa_supplicant/config.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 9e261ba..c948c5f 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1617,7 +1617,31 @@ static int wpa_config_parse_mesh_ht_mode(const struct parse_data *data,
}
+static int wpa_config_parse_mesh_basic_rates(const struct parse_data *data,
+ struct wpa_ssid *ssid, int line,
+ const char *value)
+{
+ int *rates = wpa_config_parse_int_array(value);
+
+ if (rates == NULL) {
+ wpa_printf(MSG_ERROR, "Line %d: Invalid mesh_basic_rates '%s'",
+ line, value);
+ return -1;
+ }
+ if (rates[0] == 0) {
+ os_free(rates);
+ rates = NULL;
+ }
+
+ os_free(ssid->mesh_basic_rates);
+ ssid->mesh_basic_rates = rates;
+
+ return 0;
+}
+
+
#ifndef NO_CONFIG_WRITE
+
static char * wpa_config_write_mesh_ht_mode(const struct parse_data *data,
struct wpa_ssid *ssid)
{
@@ -1643,6 +1667,13 @@ static char * wpa_config_write_mesh_ht_mode(const struct parse_data *data,
return val ? os_strdup(val) : NULL;
}
+
+static char * wpa_config_write_mesh_basic_rates(const struct parse_data *data,
+ struct wpa_ssid *ssid)
+{
+ return wpa_config_write_freqs(data, ssid->mesh_basic_rates);
+}
+
#endif /* NO_CONFIG_WRITE */
#endif /* CONFIG_MESH */
@@ -1819,6 +1850,7 @@ static const struct parse_data ssid_fields[] = {
{ INT_RANGE(frequency, 0, 65000) },
#ifdef CONFIG_MESH
{ FUNC(mesh_ht_mode) },
+ { FUNC(mesh_basic_rates) },
#endif /* CONFIG_MESH */
{ INT(wpa_ptk_rekey) },
{ STR(bgscan) },
@@ -2049,6 +2081,9 @@ void wpa_config_free_ssid(struct wpa_ssid *ssid)
#ifdef CONFIG_HT_OVERRIDES
os_free(ssid->ht_mcs);
#endif /* CONFIG_HT_OVERRIDES */
+#ifdef CONFIG_MESH
+ os_free(ssid->mesh_basic_rates);
+#endif /* CONFIG_MESH */
while ((psk = dl_list_first(&ssid->psk_list, struct psk_list_entry,
list))) {
dl_list_del(&psk->list);