These patcehs are backproted from hostapd master.
These patches are fixing problems intorudced by our patches
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- /dev/null
+From 57fec19dab8adf6af7a34711e7a3e01b4f2e4ebc Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sun, 28 Feb 2021 11:51:16 +0200
+Subject: Use more consistent iface->conf checks
+
+Commit f1df4fbfc7ad ("mesh: Use setup completion callback to complete
+mesh join") added a check for iface->conf being NULL into a debug print.
+However, it is not clear how that could be NULL here. In any case,
+setup_interface() could end up dereferencing iface->conf in the call to
+hostapd_validate_bssid_configuration(), so better be consistent with the
+checks and not get warnings from static analyzers regardless of whether
+this can happen in practice.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/ap/hostapd.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -2305,10 +2305,12 @@ int hostapd_setup_interface(struct hosta
+ {
+ int ret;
+
++ if (!iface->conf)
++ return -1;
+ ret = setup_interface(iface);
+ if (ret) {
+ wpa_printf(MSG_ERROR, "%s: Unable to setup interface.",
+- iface->conf ? iface->conf->bss[0]->iface : "N/A");
++ iface->conf->bss[0]->iface);
+ return -1;
+ }
+
--- /dev/null
+From df0bfe4759d9f3eb6d933e318abc02bab0c3cc84 Mon Sep 17 00:00:00 2001
+From: Abinaya Kalaiselvan <akalaise@codeaurora.org>
+Date: Mon, 1 Feb 2021 10:29:36 +0530
+Subject: mesh: Fix for leaving mesh
+
+Avoid multiple execution of wpa_drv_leave_mesh().
+
+Fixes: 0896c442dcd5 ("mesh: Fix for mesh init/deinit")
+Signed-off-by: Abinaya Kalaiselvan <akalaise@codeaurora.org>
+---
+ wpa_supplicant/mesh.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/wpa_supplicant/mesh.c
++++ b/wpa_supplicant/mesh.c
+@@ -44,7 +44,8 @@ static void wpa_supplicant_mesh_deinit(s
+ os_free(wpa_s->mesh_rsn);
+ wpa_s->mesh_rsn = NULL;
+
+- wpa_supplicant_leave_mesh(wpa_s, false);
++ if (!also_clear_hostapd)
++ wpa_supplicant_leave_mesh(wpa_s, false);
+ }
+
+
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
-@@ -139,6 +139,7 @@ static struct mesh_conf * mesh_config_cr
+@@ -140,6 +140,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->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries;
conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout;
conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout;
-@@ -440,6 +441,7 @@ static int wpa_supplicant_mesh_init(stru
+@@ -441,6 +442,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;
if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
wpa_s->hw.num_modes) && wpa_s->conf->country[0]) {
-@@ -654,6 +656,10 @@ int wpa_supplicant_join_mesh(struct wpa_
+@@ -655,6 +657,10 @@ int wpa_supplicant_join_mesh(struct wpa_
}
params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity;
INT(enable_edmg);
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
-@@ -473,6 +473,8 @@ static int wpa_supplicant_mesh_init(stru
+@@ -474,6 +474,8 @@ static int wpa_supplicant_mesh_init(stru
frequency);
goto out_free;
}
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
-@@ -599,6 +599,7 @@ int wpa_supplicant_join_mesh(struct wpa_
+@@ -600,6 +600,7 @@ int wpa_supplicant_join_mesh(struct wpa_
params->meshid = ssid->ssid;
params->meshid_len = ssid->ssid_len;
hostapd_set_state(iface, HAPD_IFACE_DISABLED);
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
#ifdef CONFIG_FST
-@@ -2669,6 +2674,7 @@ void hostapd_interface_deinit_free(struc
+@@ -2671,6 +2676,7 @@ void hostapd_interface_deinit_free(struc
(unsigned int) iface->conf->num_bss);
driver = iface->bss[0]->driver;
drv_priv = iface->bss[0]->drv_priv;
hapd->iconf = newconf;
hapd->conf = newconf->bss[j];
hostapd_reload_bss(hapd);
-@@ -2366,6 +2397,10 @@ hostapd_alloc_bss_data(struct hostapd_if
+@@ -2368,6 +2399,10 @@ hostapd_alloc_bss_data(struct hostapd_if
hapd->iconf = conf;
hapd->conf = bss;
hapd->iface = hapd_iface;
-From cefc52e6b93731c713f1bba1cb5e7e92105b758b Mon Sep 17 00:00:00 2001
+From 4683b72183c5435e16b905b1494f509aeb921d60 Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
-Date: Fri, 3 Jul 2020 23:00:34 +0200
-Subject: [PATCH] dfs: enter DFS state if no available channel is found
+Date: Sat, 4 Jul 2020 10:12:21 +0200
+Subject: DFS: Enter DFS state if no available channel is found
Previously hostapd would not stop transmitting when a DFS event was
detected and no available channel to switch to was available.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
- src/ap/dfs.c | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
+ src/ap/dfs.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
-@@ -1088,8 +1088,15 @@ static int hostapd_dfs_start_channel_swi
+@@ -1088,8 +1088,16 @@ static int hostapd_dfs_start_channel_swi
&oper_centr_freq_seg0_idx,
&oper_centr_freq_seg1_idx,
&skip_radar);
+ hostapd_enable_iface(iface);
+ return 0;
+ }
++
if (!skip_radar) {
iface->freq = channel->freq;
iface->conf->channel = channel->chan;
--- /dev/null
+From ef26fc19fa03f26437ea5b09b01d930eb1999b24 Mon Sep 17 00:00:00 2001
+From: Janusz Dziedzic <janusz.dziedzic@gmail.com>
+Date: Sun, 11 Oct 2020 21:01:52 +0200
+Subject: DFS: Allow switch to an available channel
+
+For EU, where preCAC is allowed, we should allow switch to DFS available
+channels, instead of restarting BSS.
+
+Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
+---
+ src/ap/dfs.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/src/ap/dfs.c
++++ b/src/ap/dfs.c
+@@ -1366,12 +1366,16 @@ int hostapd_is_dfs_overlap(struct hostap
+ if (!(chan->flag & HOSTAPD_CHAN_RADAR))
+ continue;
+
++ if ((chan->flag & HOSTAPD_CHAN_DFS_MASK) ==
++ HOSTAPD_CHAN_DFS_AVAILABLE)
++ continue;
++
+ if (center_freq - chan->freq < half_width &&
+ chan->freq - center_freq < half_width)
+ res++;
+ }
+
+- wpa_printf(MSG_DEBUG, "DFS: (%d, %d): in range: %s",
++ wpa_printf(MSG_DEBUG, "DFS CAC required: (%d, %d): in range: %s",
+ center_freq - half_width, center_freq + half_width,
+ res ? "yes" : "no");
+