And import patchset to allow 802.11s mesh on DFS channels, see also http://lists.infradead.org/pipermail/hostap/2018-April/038418.html Fix sae_password for encryption mesh (sent upstream as well). Also refreshed existing patches and fixed 463-add-mcast_rate-to-11s. Signed-off-by: Daniel Golle <daniel@makrotopia.org>master
parent
b28e995fc7
commit
d88934aa5a
@ -0,0 +1,219 @@ |
||||
From 91c0f3f6a9ecae3c9106bef8a8606fab0792dd28 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:48:58 -0700
|
||||
Subject: [PATCH 01/15] mesh: factor out mesh join function
|
||||
|
||||
mesh join function consitss of 2 parts which are preparing
|
||||
configurations and sending join event to driver.
|
||||
Since physical mesh join event could happen either right
|
||||
after mesh configuration is done or after CAC is done
|
||||
in case of DFS channel is used, factor out the function
|
||||
into 2 parts to reduce redundant calls.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 120 ++++++++++++++++--------------
|
||||
wpa_supplicant/mesh.h | 1 +
|
||||
wpa_supplicant/wpa_supplicant_i.h | 1 +
|
||||
3 files changed, 68 insertions(+), 54 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "mesh_mpm.h"
|
||||
#include "mesh_rsn.h"
|
||||
#include "mesh.h"
|
||||
+#include "drivers/driver_nl80211.h"
|
||||
|
||||
|
||||
static void wpa_supplicant_mesh_deinit(struct wpa_supplicant *wpa_s)
|
||||
@@ -359,13 +360,48 @@ void wpa_supplicant_mesh_add_scan_ie(str
|
||||
}
|
||||
|
||||
|
||||
+void wpas_join_mesh(struct wpa_supplicant *wpa_s)
|
||||
+{
|
||||
+ struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;
|
||||
+ struct wpa_ssid *ssid = wpa_s->current_ssid;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) {
|
||||
+ wpa_s->pairwise_cipher = wpa_s->mesh_rsn->pairwise_cipher;
|
||||
+ wpa_s->group_cipher = wpa_s->mesh_rsn->group_cipher;
|
||||
+ wpa_s->mgmt_group_cipher = wpa_s->mesh_rsn->mgmt_group_cipher;
|
||||
+ }
|
||||
+
|
||||
+ if (wpa_s->ifmsh) {
|
||||
+ params->ies = wpa_s->ifmsh->mconf->rsn_ie;
|
||||
+ params->ie_len = wpa_s->ifmsh->mconf->rsn_ie_len;
|
||||
+ params->basic_rates = wpa_s->ifmsh->basic_rates;
|
||||
+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE;
|
||||
+ params->conf.ht_opmode = wpa_s->ifmsh->bss[0]->iface->ht_op_mode;
|
||||
+ }
|
||||
+
|
||||
+ ret = wpa_drv_join_mesh(wpa_s, params);
|
||||
+ if (ret)
|
||||
+ wpa_msg(wpa_s, MSG_ERROR, "mesh join error=%d\n", ret);
|
||||
+
|
||||
+ /* hostapd sets the interface down until we associate */
|
||||
+ wpa_drv_set_operstate(wpa_s, 1);
|
||||
+
|
||||
+ if (!ret)
|
||||
+ wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+
|
||||
int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid)
|
||||
{
|
||||
- struct wpa_driver_mesh_join_params params;
|
||||
+ struct wpa_driver_mesh_join_params *params =
|
||||
+ os_zalloc(sizeof(struct wpa_driver_mesh_join_params));
|
||||
int ret = 0;
|
||||
|
||||
- if (!ssid || !ssid->ssid || !ssid->ssid_len || !ssid->frequency) {
|
||||
+ if (!ssid || !ssid->ssid || !ssid->ssid_len || !ssid->frequency || !params) {
|
||||
ret = -ENOENT;
|
||||
goto out;
|
||||
}
|
||||
@@ -376,22 +412,22 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
wpa_s->group_cipher = WPA_CIPHER_NONE;
|
||||
wpa_s->mgmt_group_cipher = 0;
|
||||
|
||||
- os_memset(¶ms, 0, sizeof(params));
|
||||
- params.meshid = ssid->ssid;
|
||||
- params.meshid_len = ssid->ssid_len;
|
||||
- ibss_mesh_setup_freq(wpa_s, ssid, ¶ms.freq);
|
||||
- wpa_s->mesh_ht_enabled = !!params.freq.ht_enabled;
|
||||
- wpa_s->mesh_vht_enabled = !!params.freq.vht_enabled;
|
||||
- if (params.freq.ht_enabled && params.freq.sec_channel_offset)
|
||||
- ssid->ht40 = params.freq.sec_channel_offset;
|
||||
+ params->meshid = ssid->ssid;
|
||||
+ params->meshid_len = ssid->ssid_len;
|
||||
+ ibss_mesh_setup_freq(wpa_s, ssid, ¶ms->freq);
|
||||
+ wpa_s->mesh_ht_enabled = !!params->freq.ht_enabled;
|
||||
+ wpa_s->mesh_vht_enabled = !!params->freq.vht_enabled;
|
||||
+ if (params->freq.ht_enabled && params->freq.sec_channel_offset)
|
||||
+ ssid->ht40 = params->freq.sec_channel_offset;
|
||||
+
|
||||
if (wpa_s->mesh_vht_enabled) {
|
||||
ssid->vht = 1;
|
||||
- switch (params.freq.bandwidth) {
|
||||
+ switch (params->freq.bandwidth) {
|
||||
case 80:
|
||||
- if (params.freq.center_freq2) {
|
||||
+ if (params->freq.center_freq2) {
|
||||
ssid->max_oper_chwidth = VHT_CHANWIDTH_80P80MHZ;
|
||||
ssid->vht_center_freq2 =
|
||||
- params.freq.center_freq2;
|
||||
+ params->freq.center_freq2;
|
||||
} else {
|
||||
ssid->max_oper_chwidth = VHT_CHANWIDTH_80MHZ;
|
||||
}
|
||||
@@ -405,67 +441,43 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
}
|
||||
}
|
||||
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)
|
||||
- params.beacon_int = wpa_s->conf->beacon_int;
|
||||
+ params->beacon_int = wpa_s->conf->beacon_int;
|
||||
if (ssid->dtim_period > 0)
|
||||
- params.dtim_period = ssid->dtim_period;
|
||||
+ params->dtim_period = ssid->dtim_period;
|
||||
else if (wpa_s->conf->dtim_period > 0)
|
||||
- params.dtim_period = wpa_s->conf->dtim_period;
|
||||
- params.conf.max_peer_links = wpa_s->conf->max_peer_links;
|
||||
+ params->dtim_period = wpa_s->conf->dtim_period;
|
||||
+ params->conf.max_peer_links = wpa_s->conf->max_peer_links;
|
||||
if (ssid->mesh_rssi_threshold < DEFAULT_MESH_RSSI_THRESHOLD) {
|
||||
- params.conf.rssi_threshold = ssid->mesh_rssi_threshold;
|
||||
- params.conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD;
|
||||
+ params->conf.rssi_threshold = ssid->mesh_rssi_threshold;
|
||||
+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD;
|
||||
}
|
||||
|
||||
if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) {
|
||||
- params.flags |= WPA_DRIVER_MESH_FLAG_SAE_AUTH;
|
||||
- params.flags |= WPA_DRIVER_MESH_FLAG_AMPE;
|
||||
+ params->flags |= WPA_DRIVER_MESH_FLAG_SAE_AUTH;
|
||||
+ params->flags |= WPA_DRIVER_MESH_FLAG_AMPE;
|
||||
wpa_s->conf->user_mpm = 1;
|
||||
}
|
||||
|
||||
if (wpa_s->conf->user_mpm) {
|
||||
- params.flags |= WPA_DRIVER_MESH_FLAG_USER_MPM;
|
||||
- params.conf.auto_plinks = 0;
|
||||
+ params->flags |= WPA_DRIVER_MESH_FLAG_USER_MPM;
|
||||
+ params->conf.auto_plinks = 0;
|
||||
} else {
|
||||
- params.flags |= WPA_DRIVER_MESH_FLAG_DRIVER_MPM;
|
||||
- params.conf.auto_plinks = 1;
|
||||
+ params->flags |= WPA_DRIVER_MESH_FLAG_DRIVER_MPM;
|
||||
+ params->conf.auto_plinks = 1;
|
||||
}
|
||||
- params.conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity;
|
||||
+ params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity;
|
||||
|
||||
- if (wpa_supplicant_mesh_init(wpa_s, ssid, ¶ms.freq)) {
|
||||
+ wpa_s->mesh_params = params;
|
||||
+ if (wpa_supplicant_mesh_init(wpa_s, ssid, ¶ms->freq)) {
|
||||
wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh");
|
||||
wpa_drv_leave_mesh(wpa_s);
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
- if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) {
|
||||
- wpa_s->pairwise_cipher = wpa_s->mesh_rsn->pairwise_cipher;
|
||||
- wpa_s->group_cipher = wpa_s->mesh_rsn->group_cipher;
|
||||
- wpa_s->mgmt_group_cipher = wpa_s->mesh_rsn->mgmt_group_cipher;
|
||||
- }
|
||||
-
|
||||
- if (wpa_s->ifmsh) {
|
||||
- params.ies = wpa_s->ifmsh->mconf->rsn_ie;
|
||||
- params.ie_len = wpa_s->ifmsh->mconf->rsn_ie_len;
|
||||
- params.basic_rates = wpa_s->ifmsh->basic_rates;
|
||||
- params.conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE;
|
||||
- params.conf.ht_opmode = wpa_s->ifmsh->bss[0]->iface->ht_op_mode;
|
||||
- }
|
||||
-
|
||||
- wpa_msg(wpa_s, MSG_INFO, "joining mesh %s",
|
||||
- wpa_ssid_txt(ssid->ssid, ssid->ssid_len));
|
||||
- ret = wpa_drv_join_mesh(wpa_s, ¶ms);
|
||||
- if (ret)
|
||||
- wpa_msg(wpa_s, MSG_ERROR, "mesh join error=%d", ret);
|
||||
-
|
||||
- /* hostapd sets the interface down until we associate */
|
||||
- wpa_drv_set_operstate(wpa_s, 1);
|
||||
-
|
||||
- if (!ret)
|
||||
- wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
|
||||
-
|
||||
+ wpas_join_mesh(wpa_s);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
--- a/wpa_supplicant/mesh.h
|
||||
+++ b/wpa_supplicant/mesh.h
|
||||
@@ -21,6 +21,7 @@ int wpas_mesh_add_interface(struct wpa_s
|
||||
int wpas_mesh_peer_remove(struct wpa_supplicant *wpa_s, const u8 *addr);
|
||||
int wpas_mesh_peer_add(struct wpa_supplicant *wpa_s, const u8 *addr,
|
||||
int duration);
|
||||
+void wpas_join_mesh(struct wpa_supplicant *wpa_s);
|
||||
|
||||
#ifdef CONFIG_MESH
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant_i.h
|
||||
+++ b/wpa_supplicant/wpa_supplicant_i.h
|
||||
@@ -810,6 +810,7 @@ struct wpa_supplicant {
|
||||
unsigned int mesh_if_created:1;
|
||||
unsigned int mesh_ht_enabled:1;
|
||||
unsigned int mesh_vht_enabled:1;
|
||||
+ struct wpa_driver_mesh_join_params *mesh_params;
|
||||
#ifdef CONFIG_PMKSA_CACHE_EXTERNAL
|
||||
/* struct external_pmksa_cache::list */
|
||||
struct dl_list mesh_external_pmksa_cache;
|
@ -0,0 +1,115 @@ |
||||
From 04ebcadc059a6cfd45cd8ec06e6321b69bdb68b8 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:48:59 -0700
|
||||
Subject: [PATCH 02/15] mesh: factor out rsn initialization
|
||||
|
||||
RSN initialization can be used in different phases
|
||||
if mesh initialization and mesh join don't happen
|
||||
in sequence such as DFS CAC is done in between,
|
||||
hence factor it out to help convering the case.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 73 ++++++++++++++++++++++++++-----------------
|
||||
wpa_supplicant/mesh.h | 1 +
|
||||
2 files changed, 45 insertions(+), 29 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -147,6 +147,48 @@ static void wpas_mesh_copy_groups(struct
|
||||
groups_size);
|
||||
}
|
||||
|
||||
+int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s)
|
||||
+{
|
||||
+ struct hostapd_iface *ifmsh = wpa_s->ifmsh;
|
||||
+ struct mesh_conf *mconf = wpa_s->ifmsh->mconf;
|
||||
+ struct wpa_ssid *ssid = wpa_s->current_ssid;
|
||||
+ struct hostapd_data *bss = ifmsh->bss[0];
|
||||
+ static int default_groups[] = { 19, 20, 21, 25, 26, -1 };
|
||||
+ size_t len;
|
||||
+
|
||||
+ if (mconf->security != MESH_CONF_SEC_NONE) {
|
||||
+ if (ssid->passphrase == NULL) {
|
||||
+ wpa_printf(MSG_ERROR,
|
||||
+ "mesh: Passphrase for SAE not configured");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ bss->conf->wpa = ssid->proto;
|
||||
+ bss->conf->wpa_key_mgmt = ssid->key_mgmt;
|
||||
+
|
||||
+ if (wpa_s->conf->sae_groups &&
|
||||
+ wpa_s->conf->sae_groups[0] > 0) {
|
||||
+ wpas_mesh_copy_groups(bss, wpa_s);
|
||||
+ } else {
|
||||
+ bss->conf->sae_groups =
|
||||
+ os_memdup(default_groups,
|
||||
+ sizeof(default_groups));
|
||||
+ if (!bss->conf->sae_groups)
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ len = os_strlen(ssid->passphrase);
|
||||
+ bss->conf->ssid.wpa_passphrase =
|
||||
+ dup_binstr(ssid->passphrase, len);
|
||||
+
|
||||
+ wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf);
|
||||
+ if (!wpa_s->mesh_rsn)
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
|
||||
static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid,
|
||||
@@ -291,35 +333,8 @@ static int wpa_supplicant_mesh_init(stru
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (mconf->security != MESH_CONF_SEC_NONE) {
|
||||
- if (ssid->passphrase == NULL) {
|
||||
- wpa_printf(MSG_ERROR,
|
||||
- "mesh: Passphrase for SAE not configured");
|
||||
- goto out_free;
|
||||
- }
|
||||
-
|
||||
- bss->conf->wpa = ssid->proto;
|
||||
- bss->conf->wpa_key_mgmt = ssid->key_mgmt;
|
||||
-
|
||||
- if (wpa_s->conf->sae_groups &&
|
||||
- wpa_s->conf->sae_groups[0] > 0) {
|
||||
- wpas_mesh_copy_groups(bss, wpa_s);
|
||||
- } else {
|
||||
- bss->conf->sae_groups =
|
||||
- os_memdup(default_groups,
|
||||
- sizeof(default_groups));
|
||||
- if (!bss->conf->sae_groups)
|
||||
- goto out_free;
|
||||
- }
|
||||
-
|
||||
- len = os_strlen(ssid->passphrase);
|
||||
- bss->conf->ssid.wpa_passphrase =
|
||||
- dup_binstr(ssid->passphrase, len);
|
||||
-
|
||||
- wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf);
|
||||
- if (!wpa_s->mesh_rsn)
|
||||
- goto out_free;
|
||||
- }
|
||||
+ if (wpas_mesh_init_rsn(wpa_s))
|
||||
+ goto out_free;
|
||||
|
||||
wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
|
||||
|
||||
--- a/wpa_supplicant/mesh.h
|
||||
+++ b/wpa_supplicant/mesh.h
|
||||
@@ -22,6 +22,7 @@ int wpas_mesh_peer_remove(struct wpa_sup
|
||||
int wpas_mesh_peer_add(struct wpa_supplicant *wpa_s, const u8 *addr,
|
||||
int duration);
|
||||
void wpas_join_mesh(struct wpa_supplicant *wpa_s);
|
||||
+int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s);
|
||||
|
||||
#ifdef CONFIG_MESH
|
||||
|
@ -0,0 +1,41 @@ |
||||
From cbe8b9901f9cc254cbaa1ec1cee1c52af8f828bf Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:00 -0700
|
||||
Subject: [PATCH 03/15] mesh: relocate RSN init function
|
||||
|
||||
RSN init function should work together with mesh join
|
||||
when it's used. Since mesh join could be called at different stage
|
||||
if DFS channel is used, relocate the function to mesh join.
|
||||
It is still the same call flows of mesh join before this changes
|
||||
if non-DFS channels are used, hence no side effect will occur.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -333,9 +333,6 @@ static int wpa_supplicant_mesh_init(stru
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (wpas_mesh_init_rsn(wpa_s))
|
||||
- goto out_free;
|
||||
-
|
||||
wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
|
||||
|
||||
return 0;
|
||||
@@ -381,6 +378,12 @@ void wpas_join_mesh(struct wpa_supplican
|
||||
struct wpa_ssid *ssid = wpa_s->current_ssid;
|
||||
int ret = 0;
|
||||
|
||||
+ if (wpas_mesh_init_rsn(wpa_s)) {
|
||||
+ wpa_printf(MSG_ERROR, "Init RSN failed. Deinit mesh...");
|
||||
+ wpa_supplicant_mesh_deinit(wpa_s);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) {
|
||||
wpa_s->pairwise_cipher = wpa_s->mesh_rsn->pairwise_cipher;
|
||||
wpa_s->group_cipher = wpa_s->mesh_rsn->group_cipher;
|
@ -0,0 +1,73 @@ |
||||
From 8a4ebbb6bbbc1460c1d584d1a710bf1361797ffd Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:01 -0700
|
||||
Subject: [PATCH 04/15] mesh: use setup completion callback to complete mesh
|
||||
join
|
||||
|
||||
mesh join function is the last function to be called during
|
||||
mesh join process, but it's been called a bit earlier than
|
||||
it's supposed to be, so that some mesh parameter values
|
||||
such as VHT capabilities not applied correct when mesh join
|
||||
is in process. Moreover current design of mesh join that is called
|
||||
directly after mesh initialization is not suitable for DFS channels
|
||||
to use, since mesh join process should be paused until DFS CAC is
|
||||
done and resumed once it's done.
|
||||
Using setup completion callback is how AP mode is using for DFS channels
|
||||
and mesh can use the same way.
|
||||
The callback will be called by hostapd_setup_interface_complete_sync.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 7 +++++--
|
||||
wpa_supplicant/mesh.h | 2 +-
|
||||
2 files changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -215,6 +215,7 @@ static int wpa_supplicant_mesh_init(stru
|
||||
if (!ifmsh)
|
||||
return -ENOMEM;
|
||||
|
||||
+ ifmsh->owner = wpa_s;
|
||||
ifmsh->drv_flags = wpa_s->drv_flags;
|
||||
ifmsh->num_bss = 1;
|
||||
ifmsh->bss = os_calloc(wpa_s->ifmsh->num_bss,
|
||||
@@ -231,6 +232,8 @@ static int wpa_supplicant_mesh_init(stru
|
||||
bss->drv_priv = wpa_s->drv_priv;
|
||||
bss->iface = ifmsh;
|
||||
bss->mesh_sta_free_cb = mesh_mpm_free_sta;
|
||||
+ bss->setup_complete_cb = wpas_mesh_complete_cb;
|
||||
+ bss->setup_complete_cb_ctx = wpa_s;
|
||||
frequency = ssid->frequency;
|
||||
if (frequency != freq->freq &&
|
||||
frequency == freq->freq + freq->sec_channel_offset * 20) {
|
||||
@@ -372,8 +375,9 @@ void wpa_supplicant_mesh_add_scan_ie(str
|
||||
}
|
||||
|
||||
|
||||
-void wpas_join_mesh(struct wpa_supplicant *wpa_s)
|
||||
+void wpas_mesh_complete_cb(void *ctx)
|
||||
{
|
||||
+ struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)ctx;
|
||||
struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;
|
||||
struct wpa_ssid *ssid = wpa_s->current_ssid;
|
||||
int ret = 0;
|
||||
@@ -495,7 +499,6 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
goto out;
|
||||
}
|
||||
|
||||
- wpas_join_mesh(wpa_s);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
--- a/wpa_supplicant/mesh.h
|
||||
+++ b/wpa_supplicant/mesh.h
|
||||
@@ -21,7 +21,7 @@ int wpas_mesh_add_interface(struct wpa_s
|
||||
int wpas_mesh_peer_remove(struct wpa_supplicant *wpa_s, const u8 *addr);
|
||||
int wpas_mesh_peer_add(struct wpa_supplicant *wpa_s, const u8 *addr,
|
||||
int duration);
|
||||
-void wpas_join_mesh(struct wpa_supplicant *wpa_s);
|
||||
+void wpas_mesh_complete_cb(void *ctx);
|
||||
int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s);
|
||||
|
||||
#ifdef CONFIG_MESH
|
@ -0,0 +1,32 @@ |
||||
From e223e851cbe776029a2768b56e7aa1a9f2873d09 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:02 -0700
|
||||
Subject: [PATCH 05/15] mesh: reflect country setting to mesh configuration
|
||||
|
||||
wpa_supplicant configuration has country parameter that is
|
||||
supposed to be used in AP mode to indicate supporting 802.11h
|
||||
and 802.11d. Reflect this configuration to Mesh also since Mesh
|
||||
is required to support 802.11h and 802.11d to use DFS channels.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -252,6 +252,14 @@ static int wpa_supplicant_mesh_init(stru
|
||||
bss->conf->start_disabled = 1;
|
||||
bss->conf->mesh = MESH_ENABLED;
|
||||
bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity;
|
||||
+
|
||||
+ if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) {
|
||||
+ conf->ieee80211h = 1;
|
||||
+ conf->ieee80211d = 1;
|
||||
+ conf->country[0] = wpa_s->conf->country[0];
|
||||
+ conf->country[1] = wpa_s->conf->country[1];
|
||||
+ }
|
||||
+
|
||||
bss->iconf = conf;
|
||||
ifmsh->conf = conf;
|
||||
|
@ -0,0 +1,48 @@ |
||||
From c7f107e52205dd5fdb20f7ae13413b3673b0547e Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:03 -0700
|
||||
Subject: [PATCH 06/15] mesh: inform kernel driver DFS handler in userspace
|
||||
|
||||
NL80211_ATTR_HANDLE_DFS is required by kerenel space
|
||||
to enable DFS channels that indicates DFS handler
|
||||
resides in userspace.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
src/drivers/driver.h | 1 +
|
||||
src/drivers/driver_nl80211.c | 3 +++
|
||||
wpa_supplicant/mesh.c | 1 +
|
||||
3 files changed, 5 insertions(+)
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -1390,6 +1390,7 @@ struct wpa_driver_mesh_join_params {
|
||||
#define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
|
||||
#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
|
||||
unsigned int flags;
|
||||
+ u8 handle_dfs;
|
||||
};
|
||||
|
||||
/**
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -9244,6 +9244,9 @@ static int nl80211_join_mesh(struct i802
|
||||
|
||||
wpa_printf(MSG_DEBUG, " * flags=%08X", params->flags);
|
||||
|
||||
+ if (params->handle_dfs)
|
||||
+ if (nla_put_flag(msg, NL80211_ATTR_HANDLE_DFS))
|
||||
+ goto fail;
|
||||
container = nla_nest_start(msg, NL80211_ATTR_MESH_SETUP);
|
||||
if (!container)
|
||||
goto fail;
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -258,6 +258,7 @@ static int wpa_supplicant_mesh_init(stru
|
||||
conf->ieee80211d = 1;
|
||||
conf->country[0] = wpa_s->conf->country[0];
|
||||
conf->country[1] = wpa_s->conf->country[1];
|
||||
+ wpa_s->mesh_params->handle_dfs = 1;
|
||||
}
|
||||
|
||||
bss->iconf = conf;
|
@ -0,0 +1,33 @@ |
||||
From a0c5eea22d5d1181dbe0861b24e4b9bb598f4e50 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:04 -0700
|
||||
Subject: [PATCH 07/15] mesh: apply channel attributes before running Mesh
|
||||
|
||||
This helps mesh interface initializes with correct
|
||||
channel parameters.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -334,6 +334,8 @@ static int wpa_supplicant_mesh_init(stru
|
||||
conf->basic_rates[rate_len] = -1;
|
||||
}
|
||||
|
||||
+ wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
|
||||
+
|
||||
if (hostapd_setup_interface(ifmsh)) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"Failed to initialize hostapd interface for mesh");
|
||||
@@ -345,8 +347,6 @@ static int wpa_supplicant_mesh_init(stru
|
||||
return -1;
|
||||
}
|
||||
|
||||
- wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
|
||||
-
|
||||
return 0;
|
||||
out_free:
|
||||
wpa_supplicant_mesh_deinit(wpa_s);
|
@ -0,0 +1,36 @@ |
||||
From 143809f1e60f749a5a5c72735ffa8eb99d602cc1 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:05 -0700
|
||||
Subject: [PATCH 08/15] mesh: set interface type to mesh before setting
|
||||
interface
|
||||
|
||||
Correct interface type is required to start DFS CAC that can be
|
||||
triggered during interface setup.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -336,14 +336,14 @@ static int wpa_supplicant_mesh_init(stru
|
||||
|
||||
wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
|
||||
|
||||
- if (hostapd_setup_interface(ifmsh)) {
|
||||
- wpa_printf(MSG_ERROR,
|
||||
- "Failed to initialize hostapd interface for mesh");
|
||||
+ if (wpa_drv_init_mesh(wpa_s)) {
|
||||
+ wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver");
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (wpa_drv_init_mesh(wpa_s)) {
|
||||
- wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver");
|
||||
+ if (hostapd_setup_interface(ifmsh)) {
|
||||
+ wpa_printf(MSG_ERROR,
|
||||
+ "Failed to initialize hostapd interface for mesh");
|
||||
return -1;
|
||||
}
|
||||
|
@ -0,0 +1,22 @@ |
||||
From 4347c97600f4484be8df804dfb5ed85b867d3c43 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:06 -0700
|
||||
Subject: [PATCH 09/15] mesh: set mesh center frequency
|
||||
|
||||
vht center frequency value is required to compose the correct channel info.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -453,6 +453,7 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
|
||||
if (wpa_s->mesh_vht_enabled) {
|
||||
ssid->vht = 1;
|
||||
+ ssid->vht_center_freq1 = params->freq.center_freq1;
|
||||
switch (params->freq.bandwidth) {
|
||||
case 80:
|
||||
if (params->freq.center_freq2) {
|
@ -0,0 +1,138 @@ |
||||
From d0a0e1030005834b99225feb64ec3794d31beab0 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:07 -0700
|
||||
Subject: [PATCH 10/15] mesh: consider mesh interface on dfs event handler
|
||||
|
||||
Once mesh starts supporting DFS channels, it has to handle DFS related events
|
||||
from drivers, hence add mesh interface to the check list.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/ap.c | 55 ++++++++++++++++++++++++++++++++---------
|
||||
wpa_supplicant/events.c | 1 +
|
||||
2 files changed, 44 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/ap.c
|
||||
+++ b/wpa_supplicant/ap.c
|
||||
@@ -1328,13 +1328,18 @@ int ap_ctrl_iface_chanswitch(struct wpa_
|
||||
void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht,
|
||||
int offset, int width, int cf1, int cf2)
|
||||
{
|
||||
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
||||
+
|
||||
if (!wpa_s->ap_iface)
|
||||
- return;
|
||||
+ if (!wpa_s->ifmsh)
|
||||
+ return;
|
||||
+ else
|
||||
+ iface = wpa_s->ifmsh;
|
||||
|
||||
wpa_s->assoc_freq = freq;
|
||||
if (wpa_s->current_ssid)
|
||||
wpa_s->current_ssid->frequency = freq;
|
||||
- hostapd_event_ch_switch(wpa_s->ap_iface->bss[0], freq, ht,
|
||||
+ hostapd_event_ch_switch(iface->bss[0], freq, ht,
|
||||
offset, width, cf1, cf2);
|
||||
}
|
||||
|
||||
@@ -1531,10 +1536,15 @@ int wpas_ap_pmksa_cache_add_external(str
|
||||
void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
|
||||
struct dfs_event *radar)
|
||||
{
|
||||
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
||||
+
|
||||
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
||||
- return;
|
||||
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
||||
+ return;
|
||||
+ else
|
||||
+ iface = wpa_s->ifmsh;
|
||||
wpa_printf(MSG_DEBUG, "DFS radar detected on %d MHz", radar->freq);
|
||||
- hostapd_dfs_radar_detected(wpa_s->ap_iface, radar->freq,
|
||||
+ hostapd_dfs_radar_detected(iface, radar->freq,
|
||||
radar->ht_enabled, radar->chan_offset,
|
||||
radar->chan_width,
|
||||
radar->cf1, radar->cf2);
|
||||
@@ -1544,10 +1554,15 @@ void wpas_event_dfs_radar_detected(struc
|
||||
void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
|
||||
struct dfs_event *radar)
|
||||
{
|
||||
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
||||
+
|
||||
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
||||
- return;
|
||||
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
||||
+ return;
|
||||
+ else
|
||||
+ iface = wpa_s->ifmsh;
|
||||
wpa_printf(MSG_DEBUG, "DFS CAC started on %d MHz", radar->freq);
|
||||
- hostapd_dfs_start_cac(wpa_s->ap_iface, radar->freq,
|
||||
+ hostapd_dfs_start_cac(iface, radar->freq,
|
||||
radar->ht_enabled, radar->chan_offset,
|
||||
radar->chan_width, radar->cf1, radar->cf2);
|
||||
}
|
||||
@@ -1556,10 +1571,16 @@ void wpas_event_dfs_cac_started(struct w
|
||||
void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
|
||||
struct dfs_event *radar)
|
||||
{
|
||||
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
||||
+
|
||||
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
||||
- return;
|
||||
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
||||
+ return;
|
||||
+ else
|
||||
+ iface = wpa_s->ifmsh;
|
||||
+
|
||||
wpa_printf(MSG_DEBUG, "DFS CAC finished on %d MHz", radar->freq);
|
||||
- hostapd_dfs_complete_cac(wpa_s->ap_iface, 1, radar->freq,
|
||||
+ hostapd_dfs_complete_cac(iface, 1, radar->freq,
|
||||
radar->ht_enabled, radar->chan_offset,
|
||||
radar->chan_width, radar->cf1, radar->cf2);
|
||||
}
|
||||
@@ -1568,10 +1589,15 @@ void wpas_event_dfs_cac_finished(struct
|
||||
void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
|
||||
struct dfs_event *radar)
|
||||
{
|
||||
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
||||
+
|
||||
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
||||
- return;
|
||||
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
||||
+ return;
|
||||
+ else
|
||||
+ iface = wpa_s->ifmsh;
|
||||
wpa_printf(MSG_DEBUG, "DFS CAC aborted on %d MHz", radar->freq);
|
||||
- hostapd_dfs_complete_cac(wpa_s->ap_iface, 0, radar->freq,
|
||||
+ hostapd_dfs_complete_cac(iface, 0, radar->freq,
|
||||
radar->ht_enabled, radar->chan_offset,
|
||||
radar->chan_width, radar->cf1, radar->cf2);
|
||||
}
|
||||
@@ -1580,10 +1606,15 @@ void wpas_event_dfs_cac_aborted(struct w
|
||||
void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
|
||||
struct dfs_event *radar)
|
||||
{
|
||||
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
||||
+
|
||||
if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
||||
- return;
|
||||
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
||||
+ return;
|
||||
+ else
|
||||
+ iface = wpa_s->ifmsh;
|
||||
wpa_printf(MSG_DEBUG, "DFS NOP finished on %d MHz", radar->freq);
|
||||
- hostapd_dfs_nop_finished(wpa_s->ap_iface, radar->freq,
|
||||
+ hostapd_dfs_nop_finished(iface, radar->freq,
|
||||
radar->ht_enabled, radar->chan_offset,
|
||||
radar->chan_width, radar->cf1, radar->cf2);
|
||||
}
|
||||
--- a/wpa_supplicant/events.c
|
||||
+++ b/wpa_supplicant/events.c
|
||||
@@ -4168,6 +4168,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
|
||||
if (wpa_s->current_ssid->mode == WPAS_MODE_AP ||
|
||||
wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO ||
|
||||
+ wpa_s->current_ssid->mode == WPAS_MODE_MESH ||
|
||||
wpa_s->current_ssid->mode ==
|
||||
WPAS_MODE_P2P_GROUP_FORMATION) {
|
||||
wpas_ap_ch_switch(wpa_s, data->ch_switch.freq,
|
@ -0,0 +1,79 @@ |
||||
From e7fc5d2e6b34102282ff94a6e5255af4b6e9ccb5 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:08 -0700
|
||||
Subject: [PATCH 11/15] mesh: Allow DFS channels to be selected if dfs is
|
||||
enabled
|
||||
|
||||
Note: DFS is assumed to be usable if a country code has been set
|
||||
|
||||
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/wpa_supplicant.c | 24 ++++++++++++++++++------
|
||||
1 file changed, 18 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2033,6 +2033,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
struct hostapd_freq_params vht_freq;
|
||||
int chwidth, seg0, seg1;
|
||||
u32 vht_caps = 0;
|
||||
+ int dfs_enabled = wpa_s->conf->country[0] &&
|
||||
+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
|
||||
|
||||
freq->freq = ssid->frequency;
|
||||
|
||||
@@ -2109,8 +2111,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
return;
|
||||
|
||||
/* Check primary channel flags */
|
||||
- if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (pri_chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
return;
|
||||
+ if (pri_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ return;
|
||||
|
||||
#ifdef CONFIG_HT_OVERRIDES
|
||||
if (ssid->disable_ht40)
|
||||
@@ -2136,8 +2141,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
return;
|
||||
|
||||
/* Check secondary channel flags */
|
||||
- if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (sec_chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
return;
|
||||
+ if (sec_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ return;
|
||||
|
||||
freq->channel = pri_chan->chan;
|
||||
|
||||
@@ -2227,8 +2235,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
return;
|
||||
|
||||
/* Back to HT configuration if channel not usable */
|
||||
- if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
return;
|
||||
+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ return;
|
||||
}
|
||||
|
||||
chwidth = VHT_CHANWIDTH_80MHZ;
|
||||
@@ -2248,10 +2259,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
if (!chan)
|
||||
continue;
|
||||
|
||||
- if (chan->flag & (HOSTAPD_CHAN_DISABLED |
|
||||
- HOSTAPD_CHAN_NO_IR |
|
||||
- HOSTAPD_CHAN_RADAR))
|
||||
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
continue;
|
||||
+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ continue;
|
||||
|
||||
/* Found a suitable second segment for 80+80 */
|
||||
chwidth = VHT_CHANWIDTH_80P80MHZ;
|
@ -0,0 +1,25 @@ |
||||
From 851f67301a8b9bc96c3d8cce08e355a64d30350d Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:09 -0700
|
||||
Subject: [PATCH 12/15] mesh: allow mesh to send channel switch request
|
||||
|
||||
add mesh type to nl80211 channel switch request,
|
||||
so mesh is able to send the request to kernel drivers.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
src/drivers/driver_nl80211.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -8659,7 +8659,8 @@ static int nl80211_switch_channel(void *
|
||||
}
|
||||
|
||||
if ((drv->nlmode != NL80211_IFTYPE_AP) &&
|
||||
- (drv->nlmode != NL80211_IFTYPE_P2P_GO))
|
||||
+ (drv->nlmode != NL80211_IFTYPE_P2P_GO) &&
|
||||
+ (drv->nlmode != NL80211_IFTYPE_MESH_POINT) )
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/*
|
@ -0,0 +1,27 @@ |
||||
From 5fe4fa1c1f426d81496458d2127bfbd7623fe5d5 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:10 -0700
|
||||
Subject: [PATCH 13/15] mesh: do not allow pri/sec channel switch
|
||||
|
||||
We don't want mesh to switch the channel from primary to secondary,
|
||||
since mesh points are not able to join each other in that case.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -333,7 +333,10 @@ static int wpa_supplicant_mesh_init(stru
|
||||
rate_len * sizeof(int));
|
||||
conf->basic_rates[rate_len] = -1;
|
||||
}
|
||||
-
|
||||
+ /* Do not allow primary/secondary channel switch in mesh mode,
|
||||
+ * since mesh is not able to establish a physical link for it
|
||||
+ */
|
||||
+ conf->no_pri_sec_switch = 1;
|
||||
wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
|
||||
|
||||
if (wpa_drv_init_mesh(wpa_s)) {
|
@ -0,0 +1,24 @@ |
||||
From fcc5fe675d1155d65df0471aa06f746c28b66b6c Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:11 -0700
|
||||
Subject: [PATCH 14/15] mesh: do not allow scan result to swap pri/sec
|
||||
|
||||
Swapping between primary and secondary channel will break
|
||||
mesh from joining, hence don't allow it.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/wpa_supplicant.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2158,7 +2158,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
}
|
||||
freq->sec_channel_offset = ht40;
|
||||
|
||||
- if (obss_scan) {
|
||||
+ if (ssid->mode != WPAS_MODE_MESH && obss_scan) {
|
||||
struct wpa_scan_results *scan_res;
|
||||
|
||||
scan_res = wpa_supplicant_get_scan_results(wpa_s, NULL, 0);
|
@ -0,0 +1,40 @@ |
||||
From ab2ba9fd9ac73c83dc15a6d76d93df4434d539d6 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Thu, 12 Apr 2018 02:49:12 -0700
|
||||
Subject: [PATCH 15/15] mesh: do not use offchan mgmt tx on DFS
|
||||
|
||||
Drivers don't allow mesh to use offchannel on management Tx.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
src/drivers/driver_nl80211.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -7148,6 +7148,7 @@ static int wpa_driver_nl80211_send_actio
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
int ret = -1;
|
||||
u8 *buf;
|
||||
+ int offchanok = 1;
|
||||
struct ieee80211_hdr *hdr;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, "
|
||||
@@ -7173,6 +7174,8 @@ static int wpa_driver_nl80211_send_actio
|
||||
os_memset(bss->rand_addr, 0, ETH_ALEN);
|
||||
}
|
||||
|
||||
+ if (is_mesh_interface(drv->nlmode) && ieee80211_is_dfs(freq))
|
||||
+ offchanok = 0;
|
||||
if (is_ap_interface(drv->nlmode) &&
|
||||
(!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
|
||||
(int) freq == bss->freq || drv->device_ap_sme ||
|
||||
@@ -7184,7 +7187,7 @@ static int wpa_driver_nl80211_send_actio
|
||||
ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf,
|
||||
24 + data_len,
|
||||
&drv->send_action_cookie,
|
||||
- no_cck, 0, 1, NULL, 0);
|
||||
+ no_cck, 0, offchanok, NULL, 0);
|
||||
|
||||
os_free(buf);
|
||||
return ret;
|
@ -0,0 +1,57 @@ |
||||
From 30c1693f42326d4f927e76120492bc9593b8f739 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Fri, 13 Apr 2018 00:42:10 +0200
|
||||
Subject: [PATCH] mesh: properly handle sae_password
|
||||
|
||||
The recently introduced sae_password parameter is only handled properly
|
||||
in wpa_supplicant/sme.c while wpa_supplicant/mesh.c assumed that
|
||||
ssid->passphrase exclusively holds the secret.
|
||||
Import the logic from sme.c to mesh.c to allow having only sae_password
|
||||
set which otherwise throws this error:
|
||||
AP-ENABLED
|
||||
mesh: Passphrase for SAE not configured
|
||||
Init RSN failed. Deinit mesh...
|
||||
wlan1: interface state ENABLED->DISABLED
|
||||
AP-DISABLED
|
||||
Segmentation fault
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
|
||||
index 22dec4822..0bf87245d 100644
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -154,10 +154,14 @@ int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s)
|
||||
struct wpa_ssid *ssid = wpa_s->current_ssid;
|
||||
struct hostapd_data *bss = ifmsh->bss[0];
|
||||
static int default_groups[] = { 19, 20, 21, 25, 26, -1 };
|
||||
+ const char *password;
|
||||
size_t len;
|
||||
|
||||
if (mconf->security != MESH_CONF_SEC_NONE) {
|
||||
- if (ssid->passphrase == NULL) {
|
||||
+ password = ssid->sae_password;
|
||||
+ if (!password)
|
||||
+ password = ssid->passphrase;
|
||||
+ if (!password) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"mesh: Passphrase for SAE not configured");
|
||||
return -1;
|
||||
@@ -177,9 +181,9 @@ int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- len = os_strlen(ssid->passphrase);
|
||||
+ len = os_strlen(password);
|
||||
bss->conf->ssid.wpa_passphrase =
|
||||
- dup_binstr(ssid->passphrase, len);
|
||||
+ dup_binstr(password, len);
|
||||
|
||||
wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf);
|
||||
if (!wpa_s->mesh_rsn)
|
||||
--
|
||||
2.17.0
|
||||
|
Loading…
Reference in new issue