hostapd: update to latest Git hostap_2_9-1238-gdd2daf0848ed
Bump package to latest upstream Git HEAD which is commit dd2daf0848ed ("HE: Process HE 6 GHz band capab from associating HE STA"). Since last update there was 1238 commits done in the upstream tree with 618 files changed, 53399 insertions, 24928 deletions. I didn't bothered to rebase mesh patches as the changes seems not trivial and I don't have enough knowledge of those parts to do/test that properly, so someone else has to forward port them, ideally upstream them so we don't need to bother anymore. I've just deleted them for now: 004-mesh-use-setup-completion-callback-to-complete-mesh-.patch 005-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch 006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch 007-mesh-apply-channel-attributes-before-running-Mesh.patch 011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch 013-mesh-do-not-allow-pri-sec-channel-switch.patch 015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch 016-mesh-fix-channel-switch-error-during-CAC.patch 018-mesh-make-forwarding-configurable.patch Refreshed all other patches, removed upstreamed patches: 051-wpa_supplicant-fix-race-condition-in-mesh-mpm-new-pe.patch 067-0001-AP-Silently-ignore-management-frame-from-unexpected-.patch 070-driver_nl80211-fix-WMM-queue-mapping-for-regulatory-.patch 071-driver_nl80211-fix-regulatory-limits-for-wmm-cwmin-c.patch 090-wolfssl-fix-crypto_bignum_sum.patch 091-0001-wolfssl-Fix-compiler-warnings-on-size_t-printf-forma.patch 091-0002-wolfssl-Fix-crypto_bignum_rand-implementation.patch 091-0003-wolfssl-Do-not-hardcode-include-directory-in-wpa_sup.patch 800-usleep.patch Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq8065/NBG6817; ipq40xx/MAP-AC2200] Signed-off-by: Petr Štetiar <ynezz@true.cz>master
parent
5ff4b0d024
commit
0a3ec87a66
@ -1,124 +0,0 @@
|
||||
From c05ace7510ead96e72b97ce47b33f7b5865d6d36 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Mon, 27 Aug 2018 14:28:38 -0700
|
||||
Subject: [PATCH 1/7] 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 isn't suitable for DFS channels to use,
|
||||
since mesh join process should be paused until DFS CAC is
|
||||
done and resumed after it's done.
|
||||
The callback will be called by hostapd_setup_interface_complete_sync.
|
||||
There is possiblity that completing mesh init fails, so add error
|
||||
handle codes.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
src/ap/hostapd.c | 11 ++++++++++-
|
||||
wpa_supplicant/mesh.c | 13 +++++++------
|
||||
2 files changed, 17 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -423,6 +423,8 @@ static void hostapd_free_hapd_data(struc
|
||||
#ifdef CONFIG_MESH
|
||||
wpabuf_free(hapd->mesh_pending_auth);
|
||||
hapd->mesh_pending_auth = NULL;
|
||||
+ /* handling setup failure is already done */
|
||||
+ hapd->setup_complete_cb = NULL;
|
||||
#endif /* CONFIG_MESH */
|
||||
|
||||
hostapd_clean_rrm(hapd);
|
||||
@@ -2049,6 +2051,13 @@ dfs_offload:
|
||||
if (hapd->setup_complete_cb)
|
||||
hapd->setup_complete_cb(hapd->setup_complete_cb_ctx);
|
||||
|
||||
+#ifdef CONFIG_MESH
|
||||
+ if (delay_apply_cfg && !iface->mconf) {
|
||||
+ wpa_printf(MSG_ERROR, "Error while completing mesh init");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+#endif /* CONFIG_MESH */
|
||||
+
|
||||
wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
|
||||
iface->bss[0]->conf->iface);
|
||||
if (iface->interfaces && iface->interfaces->terminate_on_error > 0)
|
||||
@@ -2192,7 +2201,7 @@ int hostapd_setup_interface(struct hosta
|
||||
ret = setup_interface(iface);
|
||||
if (ret) {
|
||||
wpa_printf(MSG_ERROR, "%s: Unable to setup interface.",
|
||||
- iface->bss[0]->conf->iface);
|
||||
+ iface->conf ? iface->conf->bss[0]->iface : "N/A");
|
||||
return -1;
|
||||
}
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -190,8 +190,9 @@ static int wpas_mesh_init_rsn(struct wpa
|
||||
}
|
||||
|
||||
|
||||
-static int wpas_mesh_complete(struct wpa_supplicant *wpa_s)
|
||||
+static void wpas_mesh_complete_cb(void *ctx)
|
||||
{
|
||||
+ struct wpa_supplicant *wpa_s = ctx;
|
||||
struct hostapd_iface *ifmsh = wpa_s->ifmsh;
|
||||
struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;
|
||||
struct wpa_ssid *ssid = wpa_s->current_ssid;
|
||||
@@ -200,7 +201,7 @@ static int wpas_mesh_complete(struct wpa
|
||||
if (!params || !ssid || !ifmsh) {
|
||||
wpa_printf(MSG_ERROR, "mesh: %s called without active mesh",
|
||||
__func__);
|
||||
- return -1;
|
||||
+ return;
|
||||
}
|
||||
|
||||
if (ifmsh->mconf->security != MESH_CONF_SEC_NONE &&
|
||||
@@ -209,7 +210,7 @@ static int wpas_mesh_complete(struct wpa
|
||||
"mesh: RSN initialization failed - deinit mesh");
|
||||
wpa_supplicant_mesh_deinit(wpa_s);
|
||||
wpa_drv_leave_mesh(wpa_s);
|
||||
- return -1;
|
||||
+ return;
|
||||
}
|
||||
|
||||
if (ssid->key_mgmt & WPA_KEY_MGMT_SAE) {
|
||||
@@ -235,8 +236,6 @@ static int wpas_mesh_complete(struct wpa
|
||||
|
||||
if (!ret)
|
||||
wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
|
||||
-
|
||||
- return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -263,6 +262,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,
|
||||
@@ -280,6 +280,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) {
|
||||
@@ -521,7 +523,6 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
goto out;
|
||||
}
|
||||
|
||||
- ret = wpas_mesh_complete(wpa_s);
|
||||
out:
|
||||
return ret;
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
From c56f18380d1d404a2abc0ea5373d294508ef1e54 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Mon, 27 Aug 2018 14:28:41 -0700
|
||||
Subject: [PATCH 2/7] mesh: update ssid->frequency as pri/sec channel switch
|
||||
|
||||
ssid->frequency is one of variables used to gets channel
|
||||
number from given frequency. Leave it as unchanged when
|
||||
pri/sec channel switched will cause picking up wrong
|
||||
channel number after applying secondary channel offset
|
||||
for HT40 and leads failing interface bring-up.
|
||||
|
||||
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
|
||||
@@ -287,6 +287,7 @@ static int wpa_supplicant_mesh_init(stru
|
||||
frequency == freq->freq + freq->sec_channel_offset * 20) {
|
||||
wpa_printf(MSG_DEBUG, "mesh: pri/sec channels switched");
|
||||
frequency = freq->freq;
|
||||
+ ssid->frequency = frequency;
|
||||
}
|
||||
wpa_s->assoc_freq = frequency;
|
||||
wpa_s->current_ssid = ssid;
|
@ -1,48 +0,0 @@
|
||||
From 593602b7f14be5c2695979639764b1c50f01bbec Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Mon, 27 Aug 2018 14:28:49 -0700
|
||||
Subject: [PATCH 7/7] 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
|
||||
@@ -1477,6 +1477,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
|
||||
@@ -9624,6 +9624,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
|
||||
@@ -309,6 +309,7 @@ static int wpa_supplicant_mesh_init(stru
|
||||
conf->country[0] = wpa_s->conf->country[0];
|
||||
conf->country[1] = wpa_s->conf->country[1];
|
||||
conf->country[2] = ' ';
|
||||
+ wpa_s->mesh_params->handle_dfs = 1;
|
||||
}
|
||||
|
||||
bss->iconf = conf;
|
@ -1,47 +0,0 @@
|
||||
From 2564184440d9d6041d11a8c7d50b31368634c3bd Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Mon, 27 Aug 2018 14:28:40 -0700
|
||||
Subject: [PATCH] mesh: Apply channel attributes before setup interface
|
||||
|
||||
This helps mesh interface initialization with correct channel
|
||||
parameters.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -249,7 +249,7 @@ static int wpa_supplicant_mesh_init(stru
|
||||
struct mesh_conf *mconf;
|
||||
int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 };
|
||||
int rate_len;
|
||||
- int frequency;
|
||||
+ int frequency, saved_freq;
|
||||
|
||||
if (!wpa_s->conf->user_mpm) {
|
||||
/* not much for us to do here */
|
||||
@@ -386,6 +386,13 @@ static int wpa_supplicant_mesh_init(stru
|
||||
conf->basic_rates[rate_len] = -1;
|
||||
}
|
||||
|
||||
+ /* Handle pri/sec switch frequency within AP configuration parameter
|
||||
+ * generation without changing the stored network profile in the end. */
|
||||
+ saved_freq = ssid->frequency;
|
||||
+ ssid->frequency = frequency;
|
||||
+ wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
|
||||
+ ssid->frequency = saved_freq;
|
||||
+
|
||||
if (wpa_drv_init_mesh(wpa_s)) {
|
||||
wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver");
|
||||
return -1;
|
||||
@@ -397,8 +404,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);
|
@ -1,78 +0,0 @@
|
||||
From 89fa0d75fb1be82330258082ed3d7fd452eb6076 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Mon, 27 Aug 2018 14:28:45 -0700
|
||||
Subject: [PATCH 3/7] 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
|
||||
@@ -2153,6 +2153,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;
|
||||
|
||||
@@ -2232,8 +2234,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;
|
||||
|
||||
freq->channel = pri_chan->chan;
|
||||
|
||||
@@ -2264,8 +2269,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;
|
||||
|
||||
if (ht40 == -1) {
|
||||
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
|
||||
@@ -2356,8 +2364,11 @@ skip_ht40:
|
||||
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 = CHANWIDTH_80MHZ;
|
||||
@@ -2377,10 +2388,11 @@ skip_ht40:
|
||||
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 = CHANWIDTH_80P80MHZ;
|
@ -1,29 +0,0 @@
|
||||
From 4f4a9b9e2e61fba334a21dadea749e4b440f42e6 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Mon, 27 Aug 2018 14:28:48 -0700
|
||||
Subject: [PATCH 6/7] mesh: don't allow pri/sec channel switch
|
||||
|
||||
This limitation isn't backed by standard, but it is known that
|
||||
mesh doesn't have capability to handle 20/40 coex change in
|
||||
current implementation and it will not able to establish
|
||||
PLINK when channel switch between primary and secondary happens.
|
||||
|
||||
Since it's unknown when we will have the implementation of handling
|
||||
20/40 coex change for mesh, it'd better to avoid them from happening
|
||||
until standard based implementation is introduced.
|
||||
|
||||
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
|
||||
@@ -386,6 +386,7 @@ static int wpa_supplicant_mesh_init(stru
|
||||
conf->basic_rates[rate_len] = -1;
|
||||
}
|
||||
|
||||
+ conf->no_pri_sec_switch = 1;
|
||||
/* Handle pri/sec switch frequency within AP configuration parameter
|
||||
* generation without changing the stored network profile in the end. */
|
||||
saved_freq = ssid->frequency;
|
@ -1,61 +0,0 @@
|
||||
From 71e9c65a7c8af90a5fd11072062b596421316452 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Mon, 27 Aug 2018 14:28:46 -0700
|
||||
Subject: [PATCH 4/7] mesh: do not set offchanok on DFS channels in non-ETSI
|
||||
|
||||
mac80211 does not allow mgmt tx to use off channel on
|
||||
DFS channels in non-ETSI domain, because it will invalidate
|
||||
CAC result on current operating channel.
|
||||
(mac80211 commit: 34373d12f3cbb74960a73431138ef619d857996f)
|
||||
Hence don't set offchanok for mgmt tx in case of DFS channels
|
||||
in non-ETSI.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
src/drivers/driver_nl80211.c | 21 ++++++++++++++++++++-
|
||||
1 file changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -7462,6 +7462,10 @@ static int wpa_driver_nl80211_send_actio
|
||||
int ret = -1;
|
||||
u8 *buf;
|
||||
struct ieee80211_hdr *hdr;
|
||||
+ struct hostapd_hw_modes *modes;
|
||||
+ int i, offchanok = 1;
|
||||
+ u16 num_modes, flags;
|
||||
+ u8 dfs_domain;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, "
|
||||
"freq=%u MHz wait=%d ms no_cck=%d)",
|
||||
@@ -7486,6 +7490,21 @@ static int wpa_driver_nl80211_send_actio
|
||||
os_memset(bss->rand_addr, 0, ETH_ALEN);
|
||||
}
|
||||
|
||||
+ if (is_mesh_interface(drv->nlmode)) {
|
||||
+ modes = nl80211_get_hw_feature_data(bss, &num_modes,
|
||||
+ &flags, &dfs_domain);
|
||||
+ if (dfs_domain != HOSTAPD_DFS_REGION_ETSI &&
|
||||
+ ieee80211_is_dfs(bss->freq, modes, num_modes))
|
||||
+ offchanok = 0;
|
||||
+ if (modes) {
|
||||
+ for (i = 0; i < num_modes; i++) {
|
||||
+ os_free(modes[i].channels);
|
||||
+ os_free(modes[i].rates);
|
||||
+ }
|
||||
+ os_free(modes);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (is_ap_interface(drv->nlmode) &&
|
||||
(!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
|
||||
(int) freq == bss->freq || drv->device_ap_sme ||
|
||||
@@ -7497,7 +7516,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;
|
@ -1,59 +0,0 @@
|
||||
From 5913d6e2a741683e7c747c046f72ca790bbe1337 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Mon, 27 Aug 2018 14:28:47 -0700
|
||||
Subject: [PATCH 5/7] mesh: fix channel switch error during CAC
|
||||
|
||||
Mesh interface has used its channel parameters that configured
|
||||
during its initialization even after channel switched due to
|
||||
DFS radar detection during CAC which caused channel switch error.
|
||||
This change fixes the error by updating its channel parameters
|
||||
when channel's been changed from initial one.
|
||||
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/mesh.c | 25 +++++++++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "utils/uuid.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
#include "common/wpa_ctrl.h"
|
||||
+#include "common/hw_features_common.h"
|
||||
#include "ap/sta_info.h"
|
||||
#include "ap/hostapd.h"
|
||||
#include "ap/ieee802_11.h"
|
||||
@@ -204,6 +205,32 @@ static void wpas_mesh_complete_cb(void *
|
||||
return;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * inspect if channel's been changed since initialized.
|
||||
+ * i.e. DFS radar detection
|
||||
+ */
|
||||
+ if (ifmsh->freq != params->freq.freq) {
|
||||
+ wpa_s->assoc_freq = ifmsh->freq;
|
||||
+ ssid->frequency = ifmsh->freq;
|
||||
+ if (hostapd_set_freq_params(¶ms->freq,
|
||||
+ ifmsh->conf->hw_mode,
|
||||
+ ifmsh->freq,
|
||||
+ ifmsh->conf->channel,
|
||||
+ ifmsh->conf->ieee80211n,
|
||||
+ ifmsh->conf->ieee80211ac,
|
||||
+ ifmsh->conf->ieee80211ax,
|
||||
+ ifmsh->conf->secondary_channel,
|
||||
+ hostapd_get_oper_chwidth(ifmsh->conf),
|
||||
+ hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf),
|
||||
+ hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf),
|
||||
+ ifmsh->current_mode->vht_capab,
|
||||
+ &ifmsh->current_mode->he_capab[IEEE80211_MODE_AP])) {
|
||||
+ wpa_printf(MSG_ERROR, "Error updating mesh frequency params.");
|
||||
+ wpa_supplicant_mesh_deinit(wpa_s);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (ifmsh->mconf->security != MESH_CONF_SEC_NONE &&
|
||||
wpas_mesh_init_rsn(wpa_s)) {
|
||||
wpa_printf(MSG_ERROR,
|
@ -1,219 +0,0 @@
|
||||
From 90fe6429624fc48bc0e5d2d7eeecb7498708b5e3 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Wed, 18 Apr 2018 19:24:31 +0200
|
||||
Subject: [PATCH 18/18] mesh: make forwarding configurable
|
||||
|
||||
Allow mesh_fwding to be specified in a mesh bss config, pass that
|
||||
to the driver (only nl80211 implemented for now) and announce
|
||||
forwarding capability accordingly.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
src/ap/ap_config.h | 2 ++
|
||||
src/drivers/driver.h | 2 ++
|
||||
src/drivers/driver_nl80211.c | 3 +++
|
||||
wpa_supplicant/config.c | 4 ++++
|
||||
wpa_supplicant/config.h | 9 +++++++++
|
||||
wpa_supplicant/config_file.c | 4 ++++
|
||||
wpa_supplicant/config_ssid.h | 5 +++++
|
||||
wpa_supplicant/mesh.c | 6 ++++++
|
||||
wpa_supplicant/mesh_mpm.c | 4 ++--
|
||||
wpa_supplicant/wpa_supplicant.conf | 3 +++
|
||||
10 files changed, 40 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -51,6 +51,7 @@ struct mesh_conf {
|
||||
int dot11MeshRetryTimeout; /* msec */
|
||||
int dot11MeshConfirmTimeout; /* msec */
|
||||
int dot11MeshHoldingTimeout; /* msec */
|
||||
+ int mesh_fwding;
|
||||
};
|
||||
|
||||
#define MAX_STA_COUNT 2007
|
||||
@@ -666,6 +667,7 @@ struct hostapd_bss_config {
|
||||
|
||||
#define MESH_ENABLED BIT(0)
|
||||
int mesh;
|
||||
+ int mesh_fwding;
|
||||
|
||||
u8 radio_measurements[RRM_CAPABILITIES_IE_LEN];
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -1450,6 +1450,7 @@ struct wpa_driver_mesh_bss_params {
|
||||
#define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
|
||||
#define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
|
||||
#define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
|
||||
+#define WPA_DRIVER_MESH_CONF_FLAG_FORWARDING 0x00000020
|
||||
/*
|
||||
* TODO: Other mesh configuration parameters would go here.
|
||||
* See NL80211_MESHCONF_* for all the mesh config parameters.
|
||||
@@ -1459,6 +1460,7 @@ struct wpa_driver_mesh_bss_params {
|
||||
int peer_link_timeout;
|
||||
int max_peer_links;
|
||||
int rssi_threshold;
|
||||
+ int forwarding;
|
||||
u16 ht_opmode;
|
||||
};
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -9592,6 +9592,9 @@ static int nl80211_put_mesh_config(struc
|
||||
if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) &&
|
||||
nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS,
|
||||
params->auto_plinks)) ||
|
||||
+ ((params->flags & WPA_DRIVER_MESH_CONF_FLAG_FORWARDING) &&
|
||||
+ nla_put_u8(msg, NL80211_MESHCONF_FORWARDING,
|
||||
+ params->forwarding)) ||
|
||||
((params->flags & WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS) &&
|
||||
nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS,
|
||||
params->max_peer_links)) ||
|
||||
--- a/wpa_supplicant/config.c
|
||||
+++ b/wpa_supplicant/config.c
|
||||
@@ -2307,6 +2307,7 @@ static const struct parse_data ssid_fiel
|
||||
#ifdef CONFIG_MESH
|
||||
{ INT_RANGE(mode, 0, 5) },
|
||||
{ INT_RANGE(no_auto_peer, 0, 1) },
|
||||
+ { INT_RANGE(mesh_fwding, 0, 1) },
|
||||
{ INT_RANGE(mesh_rssi_threshold, -255, 1) },
|
||||
#else /* CONFIG_MESH */
|
||||
{ INT_RANGE(mode, 0, 4) },
|
||||
@@ -2869,6 +2870,7 @@ void wpa_config_set_network_defaults(str
|
||||
ssid->dot11MeshRetryTimeout = DEFAULT_MESH_RETRY_TIMEOUT;
|
||||
ssid->dot11MeshConfirmTimeout = DEFAULT_MESH_CONFIRM_TIMEOUT;
|
||||
ssid->dot11MeshHoldingTimeout = DEFAULT_MESH_HOLDING_TIMEOUT;
|
||||
+ ssid->mesh_fwding = DEFAULT_MESH_FWDING;
|
||||
ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD;
|
||||
#endif /* CONFIG_MESH */
|
||||
#ifdef CONFIG_HT_OVERRIDES
|
||||
@@ -4089,6 +4091,7 @@ struct wpa_config * wpa_config_alloc_emp
|
||||
config->user_mpm = DEFAULT_USER_MPM;
|
||||
config->max_peer_links = DEFAULT_MAX_PEER_LINKS;
|
||||
config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY;
|
||||
+ config->mesh_fwding = DEFAULT_MESH_FWDING;
|
||||
config->dot11RSNASAERetransPeriod =
|
||||
DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD;
|
||||
config->fast_reauth = DEFAULT_FAST_REAUTH;
|
||||
@@ -4726,6 +4729,7 @@ static const struct global_parse_data gl
|
||||
{ INT(user_mpm), 0 },
|
||||
{ INT_RANGE(max_peer_links, 0, 255), 0 },
|
||||
{ INT(mesh_max_inactivity), 0 },
|
||||
+ { INT_RANGE(mesh_fwding, 0, 1), 0 },
|
||||
{ INT(dot11RSNASAERetransPeriod), 0 },
|
||||
#endif /* CONFIG_MESH */
|
||||
{ INT(disable_scan_offload), 0 },
|
||||
--- a/wpa_supplicant/config.h
|
||||
+++ b/wpa_supplicant/config.h
|
||||
@@ -18,6 +18,7 @@
|
||||
#define DEFAULT_USER_MPM 1
|
||||
#define DEFAULT_MAX_PEER_LINKS 99
|
||||
#define DEFAULT_MESH_MAX_INACTIVITY 300
|
||||
+#define DEFAULT_MESH_FWDING 1
|
||||
/*
|
||||
* The default dot11RSNASAERetransPeriod is defined as 40 ms in the standard,
|
||||
* but use 1000 ms in practice to avoid issues on low power CPUs.
|
||||
@@ -1327,6 +1328,14 @@ struct wpa_config {
|
||||
int mesh_max_inactivity;
|
||||
|
||||
/**
|
||||
+ * mesh_fwding - Mesh network layer-2 forwarding
|
||||
+ *
|
||||
+ * This controls whether to enable layer-2 forwarding.
|
||||
+ * By default: 1: enabled
|
||||
+ */
|
||||
+ int mesh_fwding;
|
||||
+
|
||||
+ /**
|
||||
* dot11RSNASAERetransPeriod - Timeout to retransmit SAE Auth frame
|
||||
*
|
||||
* This timeout value is used in mesh STA to retransmit
|
||||
--- a/wpa_supplicant/config_file.c
|
||||
+++ b/wpa_supplicant/config_file.c
|
||||
@@ -829,6 +829,7 @@ static void wpa_config_write_network(FIL
|
||||
#endif /* IEEE8021X_EAPOL */
|
||||
INT(mode);
|
||||
INT(no_auto_peer);
|
||||
+ INT(mesh_fwding);
|
||||
INT(frequency);
|
||||
INT(fixed_freq);
|
||||
#ifdef CONFIG_ACS
|
||||
@@ -1472,6 +1473,9 @@ static void wpa_config_write_global(FILE
|
||||
fprintf(f, "mesh_max_inactivity=%d\n",
|
||||
config->mesh_max_inactivity);
|
||||
|
||||
+ if (config->mesh_fwding != DEFAULT_MESH_FWDING)
|
||||
+ fprintf(f, "mesh_fwding=%d\n", config->mesh_fwding);
|
||||
+
|
||||
if (config->dot11RSNASAERetransPeriod !=
|
||||
DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD)
|
||||
fprintf(f, "dot11RSNASAERetransPeriod=%d\n",
|
||||
--- a/wpa_supplicant/config_ssid.h
|
||||
+++ b/wpa_supplicant/config_ssid.h
|
||||
@@ -516,6 +516,11 @@ struct wpa_ssid {
|
||||
int dot11MeshConfirmTimeout; /* msec */
|
||||
int dot11MeshHoldingTimeout; /* msec */
|
||||
|
||||
+ /**
|
||||
+ * Mesh network layer-2 forwarding
|
||||
+ */
|
||||
+ int mesh_fwding;
|
||||
+
|
||||
int ht;
|
||||
int ht40;
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -126,6 +126,7 @@ static struct mesh_conf * mesh_config_cr
|
||||
conf->mesh_cc_id = 0;
|
||||
conf->mesh_sp_id = MESH_SYNC_METHOD_NEIGHBOR_OFFSET;
|
||||
conf->mesh_auth_id = (conf->security & MESH_CONF_SEC_AUTH) ? 1 : 0;
|
||||
+ conf->mesh_fwding = ssid->mesh_fwding;
|
||||
conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries;
|
||||
conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout;
|
||||
conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout;
|
||||
@@ -328,6 +329,7 @@ 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;
|
||||
+ bss->conf->mesh_fwding = wpa_s->conf->mesh_fwding;
|
||||
|
||||
if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
|
||||
wpa_s->hw.num_modes) && wpa_s->conf->country[0]) {
|
||||
@@ -549,6 +551,10 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
}
|
||||
params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity;
|
||||
|
||||
+ /* always explicitely set forwarding to on or off for now */
|
||||
+ params->conf.flags |= WPA_DRIVER_MESH_CONF_FLAG_FORWARDING;
|
||||
+ params->conf.forwarding = ssid->mesh_fwding;
|
||||
+
|
||||
os_free(wpa_s->mesh_params);
|
||||
wpa_s->mesh_params = params;
|
||||
if (wpa_supplicant_mesh_init(wpa_s, ssid, ¶ms->freq)) {
|
||||
--- a/wpa_supplicant/mesh_mpm.c
|
||||
+++ b/wpa_supplicant/mesh_mpm.c
|
||||
@@ -305,9 +305,9 @@ static void mesh_mpm_send_plink_action(s
|
||||
info = (bss->num_plinks > 63 ? 63 : bss->num_plinks) << 1;
|
||||
/* TODO: Add Connected to Mesh Gate/AS subfields */
|
||||
wpabuf_put_u8(buf, info);
|
||||
- /* always forwarding & accepting plinks for now */
|
||||
+ /* set forwarding & always accepting plinks for now */
|
||||
wpabuf_put_u8(buf, MESH_CAP_ACCEPT_ADDITIONAL_PEER |
|
||||
- MESH_CAP_FORWARDING);
|
||||
+ (conf->mesh_fwding ? MESH_CAP_FORWARDING : 0));
|
||||
} else { /* Peer closing frame */
|
||||
/* IE: Mesh ID */
|
||||
wpabuf_put_u8(buf, WLAN_EID_MESH_ID);
|
||||
--- a/wpa_supplicant/wpa_supplicant.conf
|
||||
+++ b/wpa_supplicant/wpa_supplicant.conf
|
||||
@@ -153,6 +153,9 @@ ap_scan=1
|
||||
# This timeout value is used in mesh STA to clean up inactive stations.
|
||||
#mesh_max_inactivity=300
|
||||
|
||||
+# Enable 802.11s layer-2 routing and forwarding
|
||||
+#mesh_fwding=1
|
||||
+
|
||||
# cert_in_cb - Whether to include a peer certificate dump in events
|
||||
# This controls whether peer certificates for authentication server and
|
||||
# its certificate chain are included in EAP peer certificate events. This is
|
@ -1,34 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 12 Feb 2019 14:22:43 +0100
|
||||
Subject: [PATCH v2] wpa_supplicant: fix race condition in mesh mpm new peer
|
||||
handling
|
||||
|
||||
When wpa_supplicant receives another new peer event before the first one
|
||||
has been processed, it tries to add a station to the driver a second time
|
||||
(which fails) and then tears down the station entry until another event
|
||||
comes in.
|
||||
Fix this by only adding a station to the driver if it didn't exist already.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/wpa_supplicant/mesh_mpm.c
|
||||
+++ b/wpa_supplicant/mesh_mpm.c
|
||||
@@ -710,11 +710,12 @@ static struct sta_info * mesh_mpm_add_pe
|
||||
}
|
||||
|
||||
sta = ap_get_sta(data, addr);
|
||||
- if (!sta) {
|
||||
- sta = ap_sta_add(data, addr);
|
||||
- if (!sta)
|
||||
- return NULL;
|
||||
- }
|
||||
+ if (sta)
|
||||
+ return NULL;
|
||||
+
|
||||
+ sta = ap_sta_add(data, addr);
|
||||
+ if (!sta)
|
||||
+ return NULL;
|
||||
|
||||
/* Set WMM by default since Mesh STAs are QoS STAs */
|
||||
sta->flags |= WLAN_STA_WMM;
|
@ -1,66 +0,0 @@
|
||||
From 8c07fa9eda13e835f3f968b2e1c9a8be3a851ff9 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Thu, 29 Aug 2019 11:52:04 +0300
|
||||
Subject: [PATCH] AP: Silently ignore management frame from unexpected source
|
||||
address
|
||||
|
||||
Do not process any received Management frames with unexpected/invalid SA
|
||||
so that we do not add any state for unexpected STA addresses or end up
|
||||
sending out frames to unexpected destination. This prevents unexpected
|
||||
sequences where an unprotected frame might end up causing the AP to send
|
||||
out a response to another device and that other device processing the
|
||||
unexpected response.
|
||||
|
||||
In particular, this prevents some potential denial of service cases
|
||||
where the unexpected response frame from the AP might result in a
|
||||
connected station dropping its association.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/ap/drv_callbacks.c | 13 +++++++++++++
|
||||
src/ap/ieee802_11.c | 12 ++++++++++++
|
||||
2 files changed, 25 insertions(+)
|
||||
|
||||
--- a/src/ap/drv_callbacks.c
|
||||
+++ b/src/ap/drv_callbacks.c
|
||||
@@ -131,6 +131,19 @@ int hostapd_notif_assoc(struct hostapd_d
|
||||
"hostapd_notif_assoc: Skip event with no address");
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+ if (is_multicast_ether_addr(addr) ||
|
||||
+ is_zero_ether_addr(addr) ||
|
||||
+ os_memcmp(addr, hapd->own_addr, ETH_ALEN) == 0) {
|
||||
+ /* Do not process any frames with unexpected/invalid SA so that
|
||||
+ * we do not add any state for unexpected STA addresses or end
|
||||
+ * up sending out frames to unexpected destination. */
|
||||
+ wpa_printf(MSG_DEBUG, "%s: Invalid SA=" MACSTR
|
||||
+ " in received indication - ignore this indication silently",
|
||||
+ __func__, MAC2STR(addr));
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
random_add_randomness(addr, ETH_ALEN);
|
||||
|
||||
hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -4626,6 +4626,18 @@ int ieee802_11_mgmt(struct hostapd_data
|
||||
fc = le_to_host16(mgmt->frame_control);
|
||||
stype = WLAN_FC_GET_STYPE(fc);
|
||||
|
||||
+ if (is_multicast_ether_addr(mgmt->sa) ||
|
||||
+ is_zero_ether_addr(mgmt->sa) ||
|
||||
+ os_memcmp(mgmt->sa, hapd->own_addr, ETH_ALEN) == 0) {
|
||||
+ /* Do not process any frames with unexpected/invalid SA so that
|
||||
+ * we do not add any state for unexpected STA addresses or end
|
||||
+ * up sending out frames to unexpected destination. */
|
||||
+ wpa_printf(MSG_DEBUG, "MGMT: Invalid SA=" MACSTR
|
||||
+ " in received frame - ignore this frame silently",
|
||||
+ MAC2STR(mgmt->sa));
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (stype == WLAN_FC_STYPE_BEACON) {
|
||||
handle_beacon(hapd, mgmt, len, fi);
|
||||
return 1;
|
@ -1,41 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 23 Jan 2020 13:50:47 +0100
|
||||
Subject: [PATCH] driver_nl80211: fix WMM queue mapping for regulatory
|
||||
limit
|
||||
|
||||
nl80211 uses a different queue mapping from hostap, so AC indexes need to
|
||||
be converted.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/drivers/driver_nl80211_capa.c
|
||||
+++ b/src/drivers/driver_nl80211_capa.c
|
||||
@@ -1403,6 +1403,12 @@ static void phy_info_freq(struct hostapd
|
||||
[NL80211_WMMR_AIFSN] = { .type = NLA_U8 },
|
||||
[NL80211_WMMR_TXOP] = { .type = NLA_U16 },
|
||||
};
|
||||
+ static const u8 wmm_map[4] = {
|
||||
+ [NL80211_AC_BE] = WMM_AC_BE,
|
||||
+ [NL80211_AC_BK] = WMM_AC_BK,
|
||||
+ [NL80211_AC_VI] = WMM_AC_VI,
|
||||
+ [NL80211_AC_VO] = WMM_AC_VO,
|
||||
+ };
|
||||
struct nlattr *nl_wmm;
|
||||
struct nlattr *tb_wmm[NL80211_WMMR_MAX + 1];
|
||||
int rem_wmm, ac, count = 0;
|
||||
@@ -1424,12 +1430,13 @@ static void phy_info_freq(struct hostapd
|
||||
return;
|
||||
}
|
||||
ac = nl_wmm->nla_type;
|
||||
- if (ac < 0 || ac >= WMM_AC_NUM) {
|
||||
+ if (ac >= ARRAY_SIZE(wmm_map)) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"nl80211: Invalid AC value %d", ac);
|
||||
return;
|
||||
}
|
||||
|
||||
+ ac = wmm_map[ac];
|
||||
chan->wmm_rules[ac].min_cwmin =
|
||||
nla_get_u16(tb_wmm[NL80211_WMMR_CW_MIN]);
|
||||
chan->wmm_rules[ac].min_cwmax =
|
@ -1,47 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 23 Jan 2020 14:10:20 +0100
|
||||
Subject: [PATCH] driver_nl80211: fix regulatory limits for wmm cwmin/cwmax
|
||||
values
|
||||
|
||||
The internal WMM AC parameters use just the exponent of the CW value, while
|
||||
nl80211 reports the full CW value.
|
||||
This led to completely bogus CWmin/CWmax values in the WMM IE when a regulatory
|
||||
limit was present. Fix this by converting the value to the exponent before
|
||||
passing it on
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/drivers/driver_nl80211_capa.c
|
||||
+++ b/src/drivers/driver_nl80211_capa.c
|
||||
@@ -1336,6 +1336,18 @@ static void phy_info_vht_capa(struct hos
|
||||
}
|
||||
}
|
||||
|
||||
+static inline int cw2ecw(unsigned int cw)
|
||||
+{
|
||||
+ int bit;
|
||||
+
|
||||
+ if (cw == 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ for (bit = 1; cw != 1; bit++)
|
||||
+ cw >>= 1;
|
||||
+
|
||||
+ return bit;
|
||||
+}
|
||||
|
||||
static void phy_info_freq(struct hostapd_hw_modes *mode,
|
||||
struct hostapd_channel_data *chan,
|
||||
@@ -1438,9 +1450,9 @@ static void phy_info_freq(struct hostapd
|
||||
|
||||
ac = wmm_map[ac];
|
||||
chan->wmm_rules[ac].min_cwmin =
|
||||
- nla_get_u16(tb_wmm[NL80211_WMMR_CW_MIN]);
|
||||
+ cw2ecw(nla_get_u16(tb_wmm[NL80211_WMMR_CW_MIN]));
|
||||
chan->wmm_rules[ac].min_cwmax =
|
||||
- nla_get_u16(tb_wmm[NL80211_WMMR_CW_MAX]);
|
||||
+ cw2ecw(nla_get_u16(tb_wmm[NL80211_WMMR_CW_MAX]));
|
||||
chan->wmm_rules[ac].min_aifs =
|
||||
nla_get_u8(tb_wmm[NL80211_WMMR_AIFSN]);
|
||||
chan->wmm_rules[ac].max_txop =
|
@ -1,26 +0,0 @@
|
||||
From 1766e608ba1114220f3b3598e77aa53b50c38a6e Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@codeaurora.org>
|
||||
Date: Mon, 14 Oct 2019 19:27:47 +0300
|
||||
Subject: [PATCH] wolfSSL: Fix crypto_bignum_sub()
|
||||
|
||||
The initial crypto wrapper implementation for wolfSSL seems to have
|
||||
included a copy-paste error in crypto_bignum_sub() implementation that
|
||||
was identical to crypto_bignum_add() while mp_sub() should have been
|
||||
used instead of mp_add().
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
||||
---
|
||||
src/crypto/crypto_wolfssl.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/crypto/crypto_wolfssl.c
|
||||
+++ b/src/crypto/crypto_wolfssl.c
|
||||
@@ -1151,7 +1151,7 @@ int crypto_bignum_sub(const struct crypt
|
||||
if (TEST_FAIL())
|
||||
return -1;
|
||||
|
||||
- return mp_add((mp_int *) a, (mp_int *) b,
|
||||
+ return mp_sub((mp_int *) a, (mp_int *) b,
|
||||
(mp_int *) r) == MP_OKAY ? 0 : -1;
|
||||
}
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 6a28c4dbc102de3fed9db44637f47a10e7adfb78 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 16 May 2020 21:01:51 +0300
|
||||
Subject: [PATCH 1/3] wolfssl: Fix compiler warnings on size_t printf format
|
||||
use
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/crypto/tls_wolfssl.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/src/crypto/tls_wolfssl.c
|
||||
+++ b/src/crypto/tls_wolfssl.c
|
||||
@@ -1741,7 +1741,7 @@ struct wpabuf * tls_connection_encrypt(v
|
||||
if (!conn)
|
||||
return NULL;
|
||||
|
||||
- wpa_printf(MSG_DEBUG, "SSL: encrypt: %ld bytes", wpabuf_len(in_data));
|
||||
+ wpa_printf(MSG_DEBUG, "SSL: encrypt: %zu bytes", wpabuf_len(in_data));
|
||||
|
||||
wolfssl_reset_out_data(&conn->output);
|
||||
|
||||
@@ -1792,7 +1792,7 @@ struct wpabuf * tls_connection_decrypt(v
|
||||
}
|
||||
wpabuf_put(buf, res);
|
||||
|
||||
- wpa_printf(MSG_DEBUG, "SSL: decrypt: %ld bytes", wpabuf_len(buf));
|
||||
+ wpa_printf(MSG_DEBUG, "SSL: decrypt: %zu bytes", wpabuf_len(buf));
|
||||
|
||||
return buf;
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
From eb595b3e3ab531645a5bde71cf6385335b7a4b95 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 16 May 2020 21:02:17 +0300
|
||||
Subject: [PATCH 2/3] wolfssl: Fix crypto_bignum_rand() implementation
|
||||
|
||||
The previous implementation used mp_rand_prime() to generate a random
|
||||
value in range 0..m. That is insanely slow way of generating a random
|
||||
value since mp_rand_prime() is for generating a random _prime_ which is
|
||||
not what is needed here. Replace that implementation with generationg of
|
||||
a random value in the requested range without doing any kind of prime
|
||||
number checks or loops to reject values that are not primes.
|
||||
|
||||
This speeds up SAE and EAP-pwd routines by couple of orders of
|
||||
magnitude..
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/crypto/crypto_wolfssl.c | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/src/crypto/crypto_wolfssl.c
|
||||
+++ b/src/crypto/crypto_wolfssl.c
|
||||
@@ -1084,19 +1084,21 @@ int crypto_bignum_rand(struct crypto_big
|
||||
{
|
||||
int ret = 0;
|
||||
WC_RNG rng;
|
||||
+ size_t len;
|
||||
+ u8 *buf;
|
||||
|
||||
if (TEST_FAIL())
|
||||
return -1;
|
||||
if (wc_InitRng(&rng) != 0)
|
||||
return -1;
|
||||
- if (mp_rand_prime((mp_int *) r,
|
||||
- (mp_count_bits((mp_int *) m) + 7) / 8 * 2,
|
||||
- &rng, NULL) != 0)
|
||||
- ret = -1;
|
||||
- if (ret == 0 &&
|
||||
+ len = (mp_count_bits((mp_int *) m) + 7) / 8;
|
||||
+ buf = os_malloc(len);
|
||||
+ if (!buf || wc_RNG_GenerateBlock(&rng, buf, len) != 0 ||
|
||||
+ mp_read_unsigned_bin((mp_int *) r, buf, len) != MP_OKAY ||
|
||||
mp_mod((mp_int *) r, (mp_int *) m, (mp_int *) r) != 0)
|
||||
ret = -1;
|
||||
wc_FreeRng(&rng);
|
||||
+ bin_clear_free(buf, len);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 79488da576aeeb9400e1742fab7f463eed0fa7a1 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 16 May 2020 21:07:45 +0300
|
||||
Subject: [PATCH 3/3] wolfssl: Do not hardcode include directory in
|
||||
wpa_supplicant build
|
||||
|
||||
This is not really appropriate for any kind of cross compilations and is
|
||||
not really needed in general since system specific values can be set in
|
||||
.config.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
wpa_supplicant/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -1086,7 +1086,7 @@ endif
|
||||
|
||||
ifeq ($(CONFIG_TLS), wolfssl)
|
||||
ifdef TLS_FUNCS
|
||||
-CFLAGS += -DWOLFSSL_DER_LOAD -I/usr/local/include/wolfssl
|
||||
+CFLAGS += -DWOLFSSL_DER_LOAD
|
||||
OBJS += ../src/crypto/tls_wolfssl.o
|
||||
endif
|
||||
OBJS += ../src/crypto/crypto_wolfssl.o
|