hostapd: add some extra patches
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 5 Apr 2021 16:36:33 +0000 (18:36 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Tue, 27 Apr 2021 21:35:13 +0000 (23:35 +0200)
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>
package/network/services/hostapd/patches/021-Use-more-consistent-iface-conf-checks.patch [new file with mode: 0644]
package/network/services/hostapd/patches/022-mesh-Fix-for-leaving-mesh.patch [new file with mode: 0644]
package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch
package/network/services/hostapd/patches/301-mesh-noscan.patch
package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch
package/network/services/hostapd/patches/600-ubus_support.patch
package/network/services/hostapd/patches/700-wifi-reload.patch
package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch
package/network/services/hostapd/patches/802-DFS-Allow-switch-to-an-available-channel.patch [new file with mode: 0644]

diff --git a/package/network/services/hostapd/patches/021-Use-more-consistent-iface-conf-checks.patch b/package/network/services/hostapd/patches/021-Use-more-consistent-iface-conf-checks.patch
new file mode 100644 (file)
index 0000000..267f130
--- /dev/null
@@ -0,0 +1,34 @@
+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;
+       }
diff --git a/package/network/services/hostapd/patches/022-mesh-Fix-for-leaving-mesh.patch b/package/network/services/hostapd/patches/022-mesh-Fix-for-leaving-mesh.patch
new file mode 100644 (file)
index 0000000..1ffff6a
--- /dev/null
@@ -0,0 +1,25 @@
+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);
+ }
index 78ea7ef0d14e5b1256a583c870b30b2de5a35dac..0728e5aa65623e4b16d763b21072d239f902627a 100644 (file)
@@ -164,7 +164,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
 --- 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;
@@ -172,7 +172,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        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;
@@ -180,7 +180,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
        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;
  
index 063c2a1ed04f0ef550db7b7861afd84f57ec7611..61722ee3417b1d2fc619f8c4125ef5f821765f6a 100644 (file)
@@ -20,7 +20,7 @@
        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;
        }
index a9679602796ed0c717a175b022fb716965c28d83..70c61942f2dcdf9372f534f8ccdb5b49403e5143 100644 (file)
@@ -58,7 +58,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
  
 --- 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;
index 938840755a79c5147d3b135c89f24f1240c42a4e..57d8d1a3fc89f966f3c147af1dfe90605692a80e 100644 (file)
@@ -82,7 +82,7 @@
        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;
index c90f79f64eba90d4fe7884493c950aeb73c512a2..6284731766f2931ae259aa51f1eab7b5cdb9964c 100644 (file)
                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;
index 27e1dc4149117f25ced4eb031828795fd8c041bf..0c75c4d465aaf900d09eba4d3cb3d6be764eab6b 100644 (file)
@@ -1,7 +1,7 @@
-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.
@@ -12,12 +12,12 @@ expiring.
 
 Signed-off-by: David Bauer <mail@david-bauer.net>
 ---
- src/ap/dfs.c | 1+++++++++--
- 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);
@@ -32,6 +32,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
 +                      hostapd_enable_iface(iface);
 +                      return 0;
 +              }
++
                if (!skip_radar) {
                        iface->freq = channel->freq;
                        iface->conf->channel = channel->chan;
diff --git a/package/network/services/hostapd/patches/802-DFS-Allow-switch-to-an-available-channel.patch b/package/network/services/hostapd/patches/802-DFS-Allow-switch-to-an-available-channel.patch
new file mode 100644 (file)
index 0000000..21e5ac0
--- /dev/null
@@ -0,0 +1,33 @@
+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");