From 41dd91559a8f1c1e57f6309ec6801a25d146b768 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 13 Feb 2022 11:34:40 +0100 Subject: [PATCH] hostapd: update to latest stable upstream release Signed-off-by: John Crispin --- .../0003-hostapd-backport-latest-HEAD.patch | 1244 +++++++++-------- patches/wifi/0004-hostapd-pending-fixes.patch | 4 +- ...05-hostapd-add-wispr-bandwidth-patch.patch | 4 +- ...iple_bssid-rnr_beacon-he_co_locate-e.patch | 4 +- ...pd-move-radius-into-its-own-function.patch | 4 +- ...cally-calculate-channel-center-freq-.patch | 89 -- ...-hostapd-add-acs_exclude_dfs-support.patch | 50 - 7 files changed, 686 insertions(+), 713 deletions(-) delete mode 100644 patches/wifi/0008-hostapd-automatically-calculate-channel-center-freq-.patch delete mode 100644 patches/wifi/0009-hostapd-add-acs_exclude_dfs-support.patch diff --git a/patches/wifi/0003-hostapd-backport-latest-HEAD.patch b/patches/wifi/0003-hostapd-backport-latest-HEAD.patch index 5b4a16f63..0442caeb2 100644 --- a/patches/wifi/0003-hostapd-backport-latest-HEAD.patch +++ b/patches/wifi/0003-hostapd-backport-latest-HEAD.patch @@ -1,7 +1,7 @@ -From 7004c861a5f8cbe52a47e5888cdd8d555206e033 Mon Sep 17 00:00:00 2001 +From a14e2c52aa7001beb31b4ee25a57890aba4ee0ea Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 4 Jan 2022 06:56:05 +0100 -Subject: [PATCH 3/4] hostapd: backport latest HEAD +Subject: [PATCH 01/47] hostapd: backport latest HEAD Signed-off-by: John Crispin --- @@ -10,12 +10,12 @@ Signed-off-by: John Crispin .../hostapd/files/hostapd-basic.config | 3 + .../hostapd/files/hostapd-full.config | 5 +- .../hostapd/files/hostapd-mini.config | 3 + - .../network/services/hostapd/files/hostapd.sh | 89 +++- + .../network/services/hostapd/files/hostapd.sh | 89 ++- .../hostapd/files/wpa_supplicant-full.config | 2 +- .../hostapd/files/wpa_supplicant-p2p.config | 2 +- .../services/hostapd/files/wps-hotplug.sh | 21 +- - ...-fix-frequency-setup-with-HE-enabled.patch | 196 -------- - ...> 001-wolfssl-init-RNG-with-ECC-key.patch} | 0 + ...-fix-frequency-setup-with-HE-enabled.patch | 196 ------- + ...> 001-wolfssl-init-RNG-with-ECC-key.patch} | 6 +- ...-init-order-disable-pri-sec-channel-.patch | 126 ----- ...andle-HT40-and-mode-downgrade-in-AP-.patch | 102 ---- ...ix-frequency-config-for-non-p2p-vht-.patch | 63 --- @@ -24,30 +24,30 @@ Signed-off-by: John Crispin ...lper-functions-for-vht-he-parameters.patch | 27 - ...ompletion-callback-to-complete-mesh-.patch | 108 ---- ...-frequency-as-pri-sec-channel-switch.patch | 26 - - ...hannels-to-be-selected-if-dfs-is-ena.patch | 10 +- + ...hannels-to-be-selected-if-dfs-is-ena.patch | 60 +- ...offchanok-on-DFS-channels-in-non-ETS.patch | 53 -- - ...rministic-channel-on-channel-switch.patch} | 2 +- + ...rministic-channel-on-channel-switch.patch} | 6 +- ...-fix-channel-switch-error-during-CAC.patch | 66 --- ...rnel-driver-DFS-handler-in-userspace.patch | 48 -- .../014-mesh-fixes-for-mesh-init-deinit.patch | 158 ------ - .../015-mesh-fix-DFS-deinit-init.patch | 262 ---------- + .../015-mesh-fix-DFS-deinit-init.patch | 262 --------- ...sts-DFS-test-for-wpa_supplicant-mesh.patch | 94 ---- .../patches/017-mesh-fix-mesh_oom-test.patch | 24 - ...ve-mesh-freq-setting-to-own-function.patch | 93 ---- ...020-ignore-4addr-mode-enabling-error.patch | 73 --- - ...0-mesh-make-forwarding-configurable.patch} | 28 +- ...ix-sta-add-after-previous-connection.patch | 26 + ...use-of-uninitialized-stack-variables.patch | 25 + ...ewrite-neigh-code-to-not-depend-on-l.patch | 14 +- ...ssing-authentication-frames-in-block.patch | 8 +- .../hostapd/patches/050-build_fix.patch | 20 + + ...50-mesh-make-forwarding-configurable.patch | 219 -------- ...-case-in-peer-addition-based-on-PD-R.patch | 45 -- - .../patches/110-notify-mgmt-frames.patch | 116 ----- + .../patches/110-notify-mgmt-frames.patch | 116 ---- .../patches/110-wolfssl-compile-fix.patch | 10 - - .../120-reconfigure-wps-credentials.patch | 178 ------- + .../120-reconfigure-wps-credentials.patch | 178 ------ .../hostapd/patches/200-multicall.patch | 80 +-- .../services/hostapd/patches/300-noscan.patch | 6 +- - .../hostapd/patches/301-mesh-noscan.patch | 10 +- + .../hostapd/patches/301-mesh-noscan.patch | 17 +- .../patches/310-rescan_immediately.patch | 2 +- .../hostapd/patches/320-optional_rfkill.patch | 8 +- .../patches/330-nl80211_fix_set_freq.patch | 2 +- @@ -55,40 +55,38 @@ Signed-off-by: John Crispin .../341-mesh-ctrl-iface-channel-switch.patch | 2 +- .../patches/350-nl80211_del_beacon_bss.patch | 12 +- .../patches/360-ctrl_iface_reload.patch | 10 +- - .../hostapd/patches/370-ap_sta_support.patch | 68 ++- - .../patches/380-disable_ctrl_iface_mib.patch | 34 +- + .../hostapd/patches/370-ap_sta_support.patch | 66 +-- + .../patches/380-disable_ctrl_iface_mib.patch | 36 +- .../patches/390-wpa_ie_cap_workaround.patch | 4 +- + .../400-wps_single_auth_enc_type.patch | 2 +- .../patches/420-indicate-features.patch | 4 +- .../patches/430-hostapd_cli_ifdef.patch | 4 +- - ...dd-new-config-params-to-be-used-with.patch | 8 +- + ...dd-new-config-params-to-be-used-with.patch | 10 +- ...-use-new-parameters-during-ibss-join.patch | 4 +- .../patches/463-add-mcast_rate-to-11s.patch | 10 +- .../patches/464-fix-mesh-obss-check.patch | 2 +- - .../patches/470-survey_data_fallback.patch | 2 +- + .../patches/470-survey_data_fallback.patch | 22 +- .../patches/500-lto-jobserver-support.patch | 19 +- - ...50-WNM-allow-specifying-dialog-token.patch | 99 ++++ .../patches/590-rrm-wnm-statistics.patch | 92 ++++ - .../hostapd/patches/600-ubus_support.patch | 207 ++++++-- + .../hostapd/patches/600-ubus_support.patch | 209 +++++-- .../610-hostapd_cli_ujail_permission.patch | 33 ++ .../hostapd/patches/700-wifi-reload.patch | 53 +- .../hostapd/patches/710-vlan_no_bridge.patch | 24 +- .../patches/711-wds_bridge_force.patch | 2 +- - .../720-ACS-fix-channel-100-frequency.patch | 30 ++ .../patches/720-iface_max_num_sta.patch | 82 +++ .../hostapd/patches/730-ft_iface.patch | 6 +- .../hostapd/patches/740-snoop_iface.patch | 4 +- - ...ompilation-with-Hotspot-2.0-disabled.patch | 51 ++ ...750-qos_map_set_without_interworking.patch | 20 +- .../751-qos_map_ignore_when_unsupported.patch | 12 + ...ate-if-no-available-channel-is-found.patch | 37 -- ...of-secondary-device-types-for-P2P-gr.patch | 33 -- - .../services/hostapd/src/src/ap/ubus.c | 472 ++++++++++++++++-- + .../services/hostapd/src/src/ap/ubus.c | 515 ++++++++++++++++-- .../services/hostapd/src/src/ap/ubus.h | 37 ++ .../hostapd/src/src/utils/build_features.h | 6 +- - 80 files changed, 1462 insertions(+), 2396 deletions(-) + 78 files changed, 1361 insertions(+), 2644 deletions(-) create mode 100644 package/network/services/hostapd/files/dhcp-get-server.sh delete mode 100644 package/network/services/hostapd/patches/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch - rename package/network/services/hostapd/patches/{802-wolfssl-init-RNG-with-ECC-key.patch => 001-wolfssl-init-RNG-with-ECC-key.patch} (100%) + rename package/network/services/hostapd/patches/{802-wolfssl-init-RNG-with-ECC-key.patch => 001-wolfssl-init-RNG-with-ECC-key.patch} (85%) delete mode 100644 package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch delete mode 100644 package/network/services/hostapd/patches/003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch delete mode 100644 package/network/services/hostapd/patches/004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch @@ -98,7 +96,7 @@ Signed-off-by: John Crispin delete mode 100644 package/network/services/hostapd/patches/008-mesh-use-setup-completion-callback-to-complete-mesh-.patch delete mode 100644 package/network/services/hostapd/patches/009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch delete mode 100644 package/network/services/hostapd/patches/011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch - rename package/network/services/hostapd/patches/{019-mesh-use-deterministic-channel-on-channel-switch.patch => 011-mesh-use-deterministic-channel-on-channel-switch.patch} (97%) + rename package/network/services/hostapd/patches/{019-mesh-use-deterministic-channel-on-channel-switch.patch => 011-mesh-use-deterministic-channel-on-channel-switch.patch} (92%) delete mode 100644 package/network/services/hostapd/patches/012-mesh-fix-channel-switch-error-during-CAC.patch delete mode 100644 package/network/services/hostapd/patches/013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch delete mode 100644 package/network/services/hostapd/patches/014-mesh-fixes-for-mesh-init-deinit.patch @@ -107,26 +105,23 @@ Signed-off-by: John Crispin delete mode 100644 package/network/services/hostapd/patches/017-mesh-fix-mesh_oom-test.patch delete mode 100644 package/network/services/hostapd/patches/018-mesh-move-mesh-freq-setting-to-own-function.patch delete mode 100644 package/network/services/hostapd/patches/020-ignore-4addr-mode-enabling-error.patch - rename package/network/services/hostapd/patches/{050-mesh-make-forwarding-configurable.patch => 020-mesh-make-forwarding-configurable.patch} (89%) create mode 100644 package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch create mode 100644 package/network/services/hostapd/patches/022-hostapd-fix-use-of-uninitialized-stack-variables.patch create mode 100644 package/network/services/hostapd/patches/050-build_fix.patch + delete mode 100644 package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch delete mode 100644 package/network/services/hostapd/patches/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch delete mode 100644 package/network/services/hostapd/patches/110-notify-mgmt-frames.patch delete mode 100644 package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch delete mode 100644 package/network/services/hostapd/patches/120-reconfigure-wps-credentials.patch - create mode 100644 package/network/services/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch create mode 100644 package/network/services/hostapd/patches/590-rrm-wnm-statistics.patch create mode 100644 package/network/services/hostapd/patches/610-hostapd_cli_ujail_permission.patch - create mode 100644 package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch create mode 100644 package/network/services/hostapd/patches/720-iface_max_num_sta.patch - create mode 100644 package/network/services/hostapd/patches/741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch create mode 100644 package/network/services/hostapd/patches/751-qos_map_ignore_when_unsupported.patch delete mode 100644 package/network/services/hostapd/patches/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch delete mode 100644 package/network/services/hostapd/patches/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile -index 783c10d587..7e4056bb18 100644 +index 783c10d587..584695786f 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -1,19 +1,17 @@ @@ -149,9 +144,9 @@ index 783c10d587..7e4056bb18 100644 -PKG_SOURCE_DATE:=2020-06-08 -PKG_SOURCE_VERSION:=5a8b366233f5585e68a4ffbb604fbb4a848eb325 -PKG_MIRROR_HASH:=1b2a4947034142587a3f81eac2ea27dd64650e77f8943d973623b47533be2393 -+PKG_SOURCE_DATE:=2021-05-22 -+PKG_SOURCE_VERSION:=b102f19bcc53c7f7db3951424d4d46709b4f1986 -+PKG_MIRROR_HASH:=cb3cb968883042fc582752be1607586696c18e6ecf9808c9a8ac50e204584367 ++PKG_SOURCE_DATE:=2022-01-16 ++PKG_SOURCE_VERSION:=cff80b4f7d3c0a47c052e8187d671710f48939e4 ++PKG_MIRROR_HASH:=712965bfa11a2e601d3e1c9a51a2cf3cffc6db89abafb3df3eb0cfd83c64705b PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause @@ -805,9 +800,39 @@ index 37c17c50af..0000000000 - if (ssid->mesh_basic_rates == NULL) { - /* diff --git a/package/network/services/hostapd/patches/802-wolfssl-init-RNG-with-ECC-key.patch b/package/network/services/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch -similarity index 100% +similarity index 85% rename from package/network/services/hostapd/patches/802-wolfssl-init-RNG-with-ECC-key.patch rename to package/network/services/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch +index 84fc1c9351..994aa30626 100644 +--- a/package/network/services/hostapd/patches/802-wolfssl-init-RNG-with-ECC-key.patch ++++ b/package/network/services/hostapd/patches/001-wolfssl-init-RNG-with-ECC-key.patch +@@ -16,7 +16,7 @@ Signed-off-by: David Bauer + + --- a/src/crypto/crypto_wolfssl.c + +++ b/src/crypto/crypto_wolfssl.c +-@@ -1303,6 +1303,7 @@ int ecc_projective_add_point(ecc_point * ++@@ -1307,6 +1307,7 @@ int ecc_projective_add_point(ecc_point * + + struct crypto_ec { + ecc_key key; +@@ -24,7 +24,7 @@ Signed-off-by: David Bauer + mp_int a; + mp_int prime; + mp_int order; +-@@ -1357,6 +1358,8 @@ struct crypto_ec * crypto_ec_init(int gr ++@@ -1361,6 +1362,8 @@ struct crypto_ec * crypto_ec_init(int gr + return NULL; + + if (wc_ecc_init(&e->key) != 0 || +@@ -33,7 +33,7 @@ Signed-off-by: David Bauer + wc_ecc_set_curve(&e->key, 0, curve_id) != 0 || + mp_init(&e->a) != MP_OKAY || + mp_init(&e->prime) != MP_OKAY || +-@@ -1388,6 +1391,7 @@ void crypto_ec_deinit(struct crypto_ec* ++@@ -1392,6 +1395,7 @@ void crypto_ec_deinit(struct crypto_ec* + mp_clear(&e->order); + mp_clear(&e->prime); + mp_clear(&e->a); diff --git a/package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch b/package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch deleted file mode 100644 index c7101b1dbc..0000000000 @@ -1417,51 +1442,95 @@ index b48de67636..0000000000 - wpa_s->assoc_freq = frequency; - wpa_s->current_ssid = ssid; diff --git a/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch b/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch -index 8afeba93ed..d948c41b30 100644 +index 8afeba93ed..16d24d1000 100644 --- a/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch +++ b/package/network/services/hostapd/patches/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch -@@ -14,7 +14,7 @@ Signed-off-by: Peter Oh +@@ -14,16 +14,37 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2349,6 +2349,8 @@ void ibss_mesh_setup_freq(struct wpa_sup -+@@ -2395,6 +2395,8 @@ void ibss_mesh_setup_freq(struct wpa_sup ++@@ -2409,7 +2409,7 @@ static int drv_supports_vht(struct wpa_s ++ } ++ ++ ++-static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode) +++static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode, bool dfs_enabled) ++ { ++ int i; ++ ++@@ -2418,7 +2418,10 @@ static bool ibss_mesh_is_80mhz_avail(int ++ ++ chan = hw_get_channel_chan(mode, i, NULL); ++ if (!chan || ++- chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR)) +++ chan->flag & HOSTAPD_CHAN_DISABLED) +++ return false; +++ +++ if (!dfs_enabled && chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR)) ++ return false; ++ } ++ ++@@ -2447,6 +2450,8 @@ void ibss_mesh_setup_freq(struct wpa_sup int chwidth, seg0, seg1; u32 vht_caps = 0; - int is_24ghz; -@@ -23,7 +23,7 @@ Signed-off-by: Peter Oh +- int is_24ghz; +-+ int dfs_enabled = wpa_s->conf->country[0] && +-+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR); ++ bool is_24ghz, is_6ghz; +++ bool dfs_enabled = wpa_s->conf->country[0] && +++ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR); freq->freq = ssid->frequency; -@@ -2436,8 +2438,11 @@ void ibss_mesh_setup_freq(struct wpa_sup -+@@ -2484,8 +2486,11 @@ void ibss_mesh_setup_freq(struct wpa_sup ++@@ -2543,8 +2548,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check primary channel flags */ -@@ -36,7 +36,7 @@ Signed-off-by: Peter Oh +@@ -36,7 +57,7 @@ Signed-off-by: Peter Oh freq->channel = pri_chan->chan; -@@ -2470,8 +2475,11 @@ void ibss_mesh_setup_freq(struct wpa_sup -+@@ -2518,8 +2523,11 @@ void ibss_mesh_setup_freq(struct wpa_sup ++@@ -2577,8 +2585,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check secondary channel flags */ -@@ -49,7 +49,7 @@ Signed-off-by: Peter Oh +@@ -49,20 +70,25 @@ Signed-off-by: Peter Oh if (ht40 == -1) { if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS)) -@@ -2564,8 +2572,11 @@ skip_ht40: -+@@ -2612,8 +2620,11 @@ skip_ht40: - return; +- return; ++@@ -2667,7 +2678,7 @@ skip_to_6ghz: ++ return; - /* Back to HT configuration if channel not usable */ -@@ -62,7 +62,7 @@ Signed-off-by: Peter Oh - } +- /* 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; +- } ++ /* Back to HT configuration if channel not usable */ ++- if (!ibss_mesh_is_80mhz_avail(channel, mode)) +++ if (!ibss_mesh_is_80mhz_avail(channel, mode, dfs_enabled)) ++ return; chwidth = CHANWIDTH_80MHZ; -@@ -2585,10 +2596,12 @@ skip_ht40: -+@@ -2633,10 +2644,12 @@ skip_ht40: ++@@ -2681,7 +2692,7 @@ skip_to_6ghz: ++ * above; check the remaining four 20 MHz channels for the total ++ * of 160 MHz bandwidth. ++ */ ++- if (!ibss_mesh_is_80mhz_avail(channel + 16, mode)) +++ if (!ibss_mesh_is_80mhz_avail(channel + 16, mode, dfs_enabled)) ++ return; ++ ++ for (j = 0; j < ARRAY_SIZE(bw160); j++) { ++@@ -2711,10 +2722,12 @@ skip_to_6ghz: if (!chan) continue; @@ -1525,18 +1594,36 @@ index d491f7c4bc..0000000000 - (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) || - (int) freq == bss->freq || drv->device_ap_sme || diff --git a/package/network/services/hostapd/patches/019-mesh-use-deterministic-channel-on-channel-switch.patch b/package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch -similarity index 97% +similarity index 92% rename from package/network/services/hostapd/patches/019-mesh-use-deterministic-channel-on-channel-switch.patch rename to package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch -index 8e38a8e53c..03a1e339a9 100644 +index 8e38a8e53c..1faeacf766 100644 --- a/package/network/services/hostapd/patches/019-mesh-use-deterministic-channel-on-channel-switch.patch +++ b/package/network/services/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch +@@ -29,7 +29,7 @@ Signed-off-by: Markus Theil + + + static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1) +-@@ -480,9 +481,14 @@ dfs_get_valid_channel(struct hostapd_ifa ++@@ -483,9 +484,14 @@ dfs_get_valid_channel(struct hostapd_ifa + int num_available_chandefs; + int chan_idx, chan_idx2; + int sec_chan_idx_80p80 = -1; +@@ -44,7 +44,7 @@ Signed-off-by: Markus Theil + wpa_printf(MSG_DEBUG, "DFS: Selecting random channel"); + *secondary_channel = 0; + *oper_centr_freq_seg0_idx = 0; +-@@ -502,8 +508,20 @@ dfs_get_valid_channel(struct hostapd_ifa ++@@ -505,8 +511,20 @@ dfs_get_valid_channel(struct hostapd_ifa + if (num_available_chandefs == 0) + return NULL; + @@ -68,7 +68,7 @@ Signed-off-by: Markus Theil if (!chan) { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9473,6 +9473,10 @@ static int nl80211_switch_channel(void * -+@@ -9872,6 +9872,10 @@ static int nl80211_switch_channel(void * ++@@ -9895,6 +9895,10 @@ static int nl80211_switch_channel(void * if (ret) goto error; @@ -2406,148 +2493,15 @@ index f6751829a5..0000000000 - if (!ret) { - if (bridge_ifname[0] && val && - i802_check_bridge(drv, bss, bridge_ifname, bss->ifname) < 0) -diff --git a/package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch b/package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch -similarity index 89% -rename from package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch -rename to package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch -index 4d64ec8287..75726a6750 100644 ---- a/package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch -+++ b/package/network/services/hostapd/patches/020-mesh-make-forwarding-configurable.patch -@@ -31,7 +31,7 @@ Signed-off-by: Daniel Golle - }; - - #define MAX_STA_COUNT 2007 --@@ -701,6 +702,7 @@ struct hostapd_bss_config { -+@@ -696,6 +697,7 @@ struct hostapd_bss_config { - - #define MESH_ENABLED BIT(0) - int mesh; -@@ -41,7 +41,7 @@ Signed-off-by: Daniel Golle - - --- a/src/drivers/driver.h - +++ b/src/drivers/driver.h --@@ -1515,6 +1515,7 @@ struct wpa_driver_mesh_bss_params { -+@@ -1584,6 +1584,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 -@@ -49,7 +49,7 @@ Signed-off-by: Daniel Golle - /* - * TODO: Other mesh configuration parameters would go here. - * See NL80211_MESHCONF_* for all the mesh config parameters. --@@ -1524,6 +1525,7 @@ struct wpa_driver_mesh_bss_params { -+@@ -1593,6 +1594,7 @@ struct wpa_driver_mesh_bss_params { - int peer_link_timeout; - int max_peer_links; - int rssi_threshold; -@@ -59,7 +59,7 @@ Signed-off-by: Daniel Golle - - --- a/src/drivers/driver_nl80211.c - +++ b/src/drivers/driver_nl80211.c --@@ -10038,6 +10038,9 @@ static int nl80211_put_mesh_config(struc -+@@ -10456,6 +10456,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)) || -@@ -71,7 +71,7 @@ Signed-off-by: Daniel Golle - params->max_peer_links)) || - --- a/wpa_supplicant/config.c - +++ b/wpa_supplicant/config.c --@@ -2473,6 +2473,7 @@ static const struct parse_data ssid_fiel -+@@ -2527,6 +2527,7 @@ static const struct parse_data ssid_fiel - #ifdef CONFIG_MESH - { INT_RANGE(mode, 0, 5) }, - { INT_RANGE(no_auto_peer, 0, 1) }, -@@ -79,7 +79,7 @@ Signed-off-by: Daniel Golle - { INT_RANGE(mesh_rssi_threshold, -255, 1) }, - #else /* CONFIG_MESH */ - { INT_RANGE(mode, 0, 4) }, --@@ -3049,6 +3050,7 @@ void wpa_config_set_network_defaults(str -+@@ -3106,6 +3107,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; -@@ -87,7 +87,7 @@ Signed-off-by: Daniel Golle - ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD; - #endif /* CONFIG_MESH */ - #ifdef CONFIG_HT_OVERRIDES --@@ -4276,6 +4278,7 @@ struct wpa_config * wpa_config_alloc_emp -+@@ -4347,6 +4349,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; -@@ -95,7 +95,7 @@ Signed-off-by: Daniel Golle - config->dot11RSNASAERetransPeriod = - DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD; - config->fast_reauth = DEFAULT_FAST_REAUTH; --@@ -4914,6 +4917,7 @@ static const struct global_parse_data gl -+@@ -5047,6 +5050,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 }, -@@ -113,7 +113,7 @@ Signed-off-by: Daniel Golle - /* - * The default dot11RSNASAERetransPeriod is defined as 40 ms in the standard, - * but use 1000 ms in practice to avoid issues on low power CPUs. --@@ -1351,6 +1352,14 @@ struct wpa_config { -+@@ -1378,6 +1379,14 @@ struct wpa_config { - int mesh_max_inactivity; - - /** -@@ -130,7 +130,7 @@ Signed-off-by: Daniel Golle - * This timeout value is used in mesh STA to retransmit - --- a/wpa_supplicant/config_file.c - +++ b/wpa_supplicant/config_file.c --@@ -866,6 +866,7 @@ static void wpa_config_write_network(FIL -+@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL - #endif /* IEEE8021X_EAPOL */ - INT(mode); - INT(no_auto_peer); -@@ -138,7 +138,7 @@ Signed-off-by: Daniel Golle - INT(frequency); - INT(enable_edmg); - INT(edmg_channel); --@@ -1527,6 +1528,9 @@ static void wpa_config_write_global(FILE -+@@ -1449,6 +1450,9 @@ static void wpa_config_write_global(FILE - fprintf(f, "mesh_max_inactivity=%d\n", - config->mesh_max_inactivity); - -@@ -164,7 +164,7 @@ Signed-off-by: Daniel Golle - - --- a/wpa_supplicant/mesh.c - +++ b/wpa_supplicant/mesh.c --@@ -137,6 +137,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 - conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries; - conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout; - conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout; --@@ -434,6 +435,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 - - if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes, - wpa_s->hw.num_modes) && wpa_s->conf->country[0]) { --@@ -647,6 +649,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; - diff --git a/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch b/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch new file mode 100644 -index 0000000000..124fd8bdf1 +index 0000000000..ac02ec5ab7 --- /dev/null +++ b/package/network/services/hostapd/patches/021-fix-sta-add-after-previous-connection.patch @@ -0,0 +1,26 @@ +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c -+@@ -4942,6 +4942,13 @@ static int add_associated_sta(struct hos ++@@ -4944,6 +4944,13 @@ static int add_associated_sta(struct hos + * drivers to accept the STA parameter configuration. Since this is + * after a new FT-over-DS exchange, a new TK has been derived, so key + * reinstallation is not a concern for this case. @@ -2561,7 +2515,7 @@ index 0000000000..124fd8bdf1 + */ + wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR + " (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)", -+@@ -4955,7 +4962,8 @@ static int add_associated_sta(struct hos ++@@ -4957,7 +4964,8 @@ static int add_associated_sta(struct hos + (!(sta->flags & WLAN_STA_AUTHORIZED) || + (reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) || + (!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) && @@ -2603,7 +2557,7 @@ index 0000000000..c7da33f029 + + if (!params->channel) { diff --git a/package/network/services/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch b/package/network/services/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch -index f65362fe96..e8a78e355e 100644 +index f65362fe96..ade0b11311 100644 --- a/package/network/services/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch +++ b/package/network/services/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau @@ -2611,7 +2565,7 @@ index f65362fe96..e8a78e355e 100644 #include #include -@@ -4965,26 +4962,29 @@ fail: -+@@ -5284,26 +5281,29 @@ fail: ++@@ -5300,26 +5297,29 @@ fail: static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr) { @@ -2620,7 +2574,7 @@ index f65362fe96..e8a78e355e 100644 wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for " MACSTR " ifindex=%d failed: %s", MAC2STR(addr), -@@ -4994,9 +4994,8 @@ static void rtnl_neigh_delete_fdb_entry( -+@@ -5313,9 +5313,8 @@ static void rtnl_neigh_delete_fdb_entry( ++@@ -5329,9 +5329,8 @@ static void rtnl_neigh_delete_fdb_entry( MACSTR, MAC2STR(addr)); } @@ -2629,7 +2583,7 @@ index f65362fe96..e8a78e355e 100644 -@@ -7337,7 +7336,6 @@ static void *i802_init(struct hostapd_da -+@@ -7691,7 +7690,6 @@ static void *i802_init(struct hostapd_da ++@@ -7714,7 +7713,6 @@ static void *i802_init(struct hostapd_da (params->num_bridge == 0 || !params->bridge[0])) add_ifidx(drv, br_ifindex, drv->ifindex); @@ -2638,7 +2592,7 @@ index f65362fe96..e8a78e355e 100644 int err; -@@ -7354,7 +7352,6 @@ static void *i802_init(struct hostapd_da -+@@ -7708,7 +7706,6 @@ static void *i802_init(struct hostapd_da ++@@ -7731,7 +7729,6 @@ static void *i802_init(struct hostapd_da goto failed; } } @@ -2647,7 +2601,7 @@ index f65362fe96..e8a78e355e 100644 if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) { wpa_printf(MSG_DEBUG, -@@ -10238,13 +10235,14 @@ static int wpa_driver_br_add_ip_neigh(vo -+@@ -10655,13 +10652,14 @@ static int wpa_driver_br_add_ip_neigh(vo ++@@ -10678,13 +10675,14 @@ static int wpa_driver_br_add_ip_neigh(vo const u8 *ipaddr, int prefixlen, const u8 *addr) { @@ -2656,7 +2610,7 @@ index f65362fe96..e8a78e355e 100644 if (!ipaddr || prefixlen == 0 || !addr) -@@ -10263,85 +10261,66 @@ static int wpa_driver_br_add_ip_neigh(vo -+@@ -10680,85 +10678,66 @@ static int wpa_driver_br_add_ip_neigh(vo ++@@ -10703,85 +10701,66 @@ static int wpa_driver_br_add_ip_neigh(vo } if (version == 4) { @@ -2665,7 +2619,7 @@ index f65362fe96..e8a78e355e 100644 } else { return -EINVAL; -@@ -10359,41 +10338,30 @@ static int wpa_driver_br_delete_ip_neigh -+@@ -10776,41 +10755,30 @@ static int wpa_driver_br_delete_ip_neigh ++@@ -10799,41 +10778,30 @@ static int wpa_driver_br_delete_ip_neigh return -1; } @@ -2694,7 +2648,7 @@ index 55dd980cd7..6d9fd81acf 100644 + (sta->flags & WLAN_STA_ASSOC)) { diff --git a/package/network/services/hostapd/patches/050-build_fix.patch b/package/network/services/hostapd/patches/050-build_fix.patch new file mode 100644 -index 0000000000..3da88fe290 +index 0000000000..2652a83316 --- /dev/null +++ b/package/network/services/hostapd/patches/050-build_fix.patch @@ -0,0 +1,20 @@ @@ -2710,7 +2664,7 @@ index 0000000000..3da88fe290 + CFLAGS += -DCONFIG_FILS_SK_PFS +--- a/wpa_supplicant/Makefile ++++ b/wpa_supplicant/Makefile -+@@ -309,6 +309,7 @@ endif ++@@ -312,6 +312,7 @@ endif + ifdef CONFIG_FILS + CFLAGS += -DCONFIG_FILS + NEED_SHA384=y @@ -2718,6 +2672,231 @@ index 0000000000..3da88fe290 + NEED_AES_SIV=y + ifdef CONFIG_FILS_SK_PFS + CFLAGS += -DCONFIG_FILS_SK_PFS +diff --git a/package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch b/package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch +deleted file mode 100644 +index 4d64ec8287..0000000000 +--- a/package/network/services/hostapd/patches/050-mesh-make-forwarding-configurable.patch ++++ /dev/null +@@ -1,219 +0,0 @@ +-From 90fe6429624fc48bc0e5d2d7eeecb7498708b5e3 Mon Sep 17 00:00:00 2001 +-From: Daniel Golle +-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 +---- +- 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 +-@@ -701,6 +702,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 +-@@ -1515,6 +1515,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. +-@@ -1524,6 +1525,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 +-@@ -10038,6 +10038,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 +-@@ -2473,6 +2473,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) }, +-@@ -3049,6 +3050,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 +-@@ -4276,6 +4278,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; +-@@ -4914,6 +4917,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. +-@@ -1351,6 +1352,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 +-@@ -866,6 +866,7 @@ static void wpa_config_write_network(FIL +- #endif /* IEEE8021X_EAPOL */ +- INT(mode); +- INT(no_auto_peer); +-+ INT(mesh_fwding); +- INT(frequency); +- INT(enable_edmg); +- INT(edmg_channel); +-@@ -1527,6 +1528,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 +-@@ -546,6 +546,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 +-@@ -137,6 +137,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; +-@@ -434,6 +435,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]) { +-@@ -647,6 +649,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 +-@@ -303,9 +303,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 +-@@ -150,6 +150,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 diff --git a/package/network/services/hostapd/patches/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch b/package/network/services/hostapd/patches/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch deleted file mode 100644 index 1202ff3725..0000000000 @@ -3092,7 +3271,7 @@ index 1826b6685b..0000000000 - - int wps_registrar_add_nfc_pw_token(struct wps_registrar *reg, diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch -index 9119a24c55..ceeaf5169b 100644 +index 9119a24c55..ad82e020f6 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -1,14 +1,14 @@ @@ -3132,7 +3311,7 @@ index 9119a24c55..ceeaf5169b 100644 -@@ -1311,6 +1317,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) - - BCHECK=../src/drivers/build.hostapd -+@@ -1278,6 +1284,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) ++@@ -1281,6 +1287,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) + _OBJS_VAR := OBJS + include ../src/objs.mk @@ -3149,7 +3328,7 @@ index 9119a24c55..ceeaf5169b 100644 -@@ -1374,6 +1386,12 @@ SOBJS += ../src/crypto/sha256-kdf.o - SOBJS += ../src/crypto/sha384-kdf.o - SOBJS += ../src/crypto/sha512-kdf.o -+@@ -1352,6 +1364,12 @@ include ../src/objs.mk ++@@ -1355,6 +1367,12 @@ include ../src/objs.mk + _OBJS_VAR := SOBJS + include ../src/objs.mk @@ -3173,7 +3352,7 @@ index 9119a24c55..ceeaf5169b 100644 - # Add VERSION_STR postfix for builds from a git repository -@@ -369,7 +370,9 @@ endif + ifdef LIBS -+@@ -360,7 +361,9 @@ endif ++@@ -363,7 +364,9 @@ endif ifdef CONFIG_IBSS_RSN NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_IBSS_RSN @@ -3182,7 +3361,7 @@ index 9119a24c55..ceeaf5169b 100644 endif -@@ -890,6 +893,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS -+@@ -898,6 +901,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS ++@@ -900,6 +903,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -3191,7 +3370,7 @@ index 9119a24c55..ceeaf5169b 100644 ifdef CONFIG_AP -@@ -897,9 +904,11 @@ NEED_EAP_COMMON=y -+@@ -905,9 +912,11 @@ NEED_EAP_COMMON=y ++@@ -907,9 +914,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -3200,7 +3379,7 @@ index 9119a24c55..ceeaf5169b 100644 OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -979,6 +988,12 @@ endif -+@@ -987,6 +996,12 @@ endif ++@@ -989,6 +998,12 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -3209,7 +3388,7 @@ index 9119a24c55..ceeaf5169b 100644 ifdef CONFIG_MBO -@@ -987,7 +1002,9 @@ CFLAGS += -DCONFIG_MBO -+@@ -995,7 +1010,9 @@ CFLAGS += -DCONFIG_MBO ++@@ -997,7 +1012,9 @@ CFLAGS += -DCONFIG_MBO endif ifdef NEED_RSN_AUTHENTICATOR @@ -3220,7 +3399,7 @@ index 9119a24c55..ceeaf5169b 100644 -@@ -1897,6 +1914,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) - - $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config -+@@ -1890,6 +1907,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) ++@@ -1891,6 +1908,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) + _OBJS_VAR := OBJS + include ../src/objs.mk @@ -3232,7 +3411,7 @@ index 9119a24c55..ceeaf5169b 100644 $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -1997,6 +2020,12 @@ endif -+@@ -2022,6 +2045,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) ++@@ -2023,6 +2046,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ @$(E) " sed" $< @@ -3241,7 +3420,7 @@ index 9119a24c55..ceeaf5169b 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5886,8 +5886,8 @@ union wpa_event_data { -+@@ -6025,8 +6025,8 @@ union wpa_event_data { ++@@ -6033,8 +6033,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -3250,7 +3429,7 @@ index 9119a24c55..ceeaf5169b 100644 /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -5899,7 +5899,7 @@ void wpa_supplicant_event(void *ctx, enu -+@@ -6038,7 +6038,7 @@ void wpa_supplicant_event(void *ctx, enu ++@@ -6046,7 +6046,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -3259,7 +3438,7 @@ index 9119a24c55..ceeaf5169b 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1789,8 +1789,8 @@ err: -+@@ -1836,8 +1836,8 @@ err: ++@@ -1842,8 +1842,8 @@ err: #endif /* CONFIG_OWE */ @@ -3268,7 +3447,7 @@ index 9119a24c55..ceeaf5169b 100644 struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -2035,7 +2035,7 @@ void wpa_supplicant_event(void *ctx, enu -+@@ -2082,7 +2082,7 @@ void wpa_supplicant_event(void *ctx, enu ++@@ -2088,7 +2088,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -3277,7 +3456,7 @@ index 9119a24c55..ceeaf5169b 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4579,8 +4579,8 @@ static void wpas_event_unprot_beacon(str -+@@ -4665,8 +4665,8 @@ static void wpas_event_unprot_beacon(str ++@@ -4891,8 +4891,8 @@ static void wpas_event_unprot_beacon(str } @@ -3286,7 +3465,7 @@ index 9119a24c55..ceeaf5169b 100644 struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -5398,7 +5398,7 @@ void wpa_supplicant_event(void *ctx, enu -+@@ -5511,7 +5511,7 @@ void wpa_supplicant_event(void *ctx, enu ++@@ -5745,7 +5745,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -3295,7 +3474,7 @@ index 9119a24c55..ceeaf5169b 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -6594,7 +6594,6 @@ struct wpa_interface * wpa_supplicant_ma -+@@ -6819,7 +6819,6 @@ struct wpa_interface * wpa_supplicant_ma ++@@ -7043,7 +7043,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -3304,7 +3483,7 @@ index 9119a24c55..ceeaf5169b 100644 * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -6631,6 +6630,11 @@ static int wpa_supplicant_match_existing -+@@ -6854,6 +6853,11 @@ static int wpa_supplicant_match_existing ++@@ -7078,6 +7077,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -3313,7 +3492,7 @@ index 9119a24c55..ceeaf5169b 100644 /** * wpa_supplicant_add_iface - Add a new network interface -@@ -6887,6 +6891,8 @@ struct wpa_global * wpa_supplicant_init( -+@@ -7110,6 +7114,8 @@ struct wpa_global * wpa_supplicant_init( ++@@ -7334,6 +7338,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ @@ -3345,14 +3524,14 @@ index 9119a24c55..ceeaf5169b 100644 return -1; diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch -index 638b76f84e..93b0934283 100644 +index 638b76f84e..01a33d0d03 100644 --- a/package/network/services/hostapd/patches/300-noscan.patch +++ b/package/network/services/hostapd/patches/300-noscan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3493,6 +3493,10 @@ static int hostapd_config_fill(struct ho -+@@ -3459,6 +3459,10 @@ static int hostapd_config_fill(struct ho ++@@ -3474,6 +3474,10 @@ static int hostapd_config_fill(struct ho if (bss->ocv && !bss->ieee80211w) bss->ieee80211w = 1; #endif /* CONFIG_OCV */ @@ -3361,7 +3540,7 @@ index 638b76f84e..93b0934283 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -984,6 +984,8 @@ struct hostapd_config { -+@@ -1009,6 +1009,8 @@ struct hostapd_config { ++@@ -1014,6 +1014,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; @@ -3375,7 +3554,7 @@ index 638b76f84e..93b0934283 100644 /* Check that HT40 is used and PRI / SEC switch is allowed */ diff --git a/package/network/services/hostapd/patches/301-mesh-noscan.patch b/package/network/services/hostapd/patches/301-mesh-noscan.patch -index f85b72453e..0d78329441 100644 +index f85b72453e..e682efb543 100644 --- a/package/network/services/hostapd/patches/301-mesh-noscan.patch +++ b/package/network/services/hostapd/patches/301-mesh-noscan.patch @@ -1,6 +1,6 @@ @@ -3391,7 +3570,7 @@ index f85b72453e..0d78329441 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -866,6 +866,7 @@ static void wpa_config_write_network(FIL -+@@ -768,6 +768,7 @@ static void wpa_config_write_network(FIL ++@@ -769,6 +769,7 @@ static void wpa_config_write_network(FIL #endif /* IEEE8021X_EAPOL */ INT(mode); INT(no_auto_peer); @@ -3400,37 +3579,57 @@ index f85b72453e..0d78329441 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -467,6 +467,8 @@ static int wpa_supplicant_mesh_init(stru -+@@ -474,6 +474,8 @@ static int wpa_supplicant_mesh_init(stru ++@@ -505,6 +505,8 @@ static int wpa_supplicant_mesh_init(stru frequency); goto out_free; } -@@ -31,7 +31,7 @@ +@@ -31,14 +31,17 @@ /* --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2334,12 +2334,12 @@ void ibss_mesh_setup_freq(struct wpa_sup -+@@ -2384,12 +2384,12 @@ void ibss_mesh_setup_freq(struct wpa_sup ++@@ -2436,7 +2436,7 @@ void ibss_mesh_setup_freq(struct wpa_sup int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode); enum hostapd_hw_mode hw_mode; struct hostapd_hw_modes *mode = NULL; -@@ -46,7 +46,7 @@ + - int ht40plus[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, + + int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, + 184, 192 }; +- int vht80[] = { 36, 52, 100, 116, 132, 149 }; ++ int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, ++ 6035, 6115, 6195, 6275, 6355, 6435, 6515, ++@@ -2444,7 +2444,7 @@ void ibss_mesh_setup_freq(struct wpa_sup ++ int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 }; + struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL; + u8 channel; + - int i, chan_idx, ht40 = -1, res, obss_scan = 1; +@@ -46,7 +49,7 @@ unsigned int j, k; struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; -@@ -2421,7 +2421,7 @@ void ibss_mesh_setup_freq(struct wpa_sup -+@@ -2473,7 +2473,7 @@ void ibss_mesh_setup_freq(struct wpa_sup ++@@ -2535,7 +2535,7 @@ void ibss_mesh_setup_freq(struct wpa_sup #endif /* CONFIG_HE_OVERRIDES */ /* Setup higher BW only for 5 GHz */ +@@ -57,7 +60,7 @@ + for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) { + --- a/wpa_supplicant/config_ssid.h + +++ b/wpa_supplicant/config_ssid.h +-@@ -971,6 +971,8 @@ struct wpa_ssid { ++@@ -974,6 +974,8 @@ struct wpa_ssid { + */ + int no_auto_peer; + diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch -index 0040b61c6b..7f5e207069 100644 +index 0040b61c6b..b0c1cb8354 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -4949,7 +4949,7 @@ wpa_supplicant_alloc(struct wpa_supplica -+@@ -5154,7 +5154,7 @@ wpa_supplicant_alloc(struct wpa_supplica ++@@ -5377,7 +5377,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; @@ -3474,14 +3673,14 @@ index a703c7e132..01537790e0 100644 ifdef NEED_RFKILL DRV_OBJS += ../src/drivers/rfkill.o diff --git a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch -index ccd8589728..ca586d862c 100644 +index ccd8589728..37033c3035 100644 --- a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch +++ b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4661,7 +4661,7 @@ static int nl80211_set_channel(struct i8 -+@@ -4970,7 +4970,7 @@ static int nl80211_set_channel(struct i8 ++@@ -4986,7 +4986,7 @@ static int nl80211_set_channel(struct i8 freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled, freq->bandwidth, freq->center_freq1, freq->center_freq2); @@ -3516,26 +3715,26 @@ index e0e62c2a11..3d51a47a1e 100644 iface->conf = newconf; diff --git a/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch b/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch -index 90fa5eff5d..73f81f65e6 100644 +index 90fa5eff5d..b13dcb0673 100644 --- a/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch +++ b/package/network/services/hostapd/patches/341-mesh-ctrl-iface-channel-switch.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1466,15 +1466,35 @@ int ap_switch_channel(struct wpa_supplic -+@@ -1513,15 +1513,35 @@ int ap_switch_channel(struct wpa_supplic ++@@ -1611,15 +1611,35 @@ int ap_switch_channel(struct wpa_supplic #ifdef CONFIG_CTRL_IFACE diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch -index 076950fe35..656b744aa7 100644 +index 076950fe35..35567838f5 100644 --- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -2803,10 +2803,15 @@ static int wpa_driver_nl80211_del_beacon -+@@ -2915,10 +2915,15 @@ static int wpa_driver_nl80211_del_beacon ++@@ -2931,10 +2931,15 @@ static int wpa_driver_nl80211_del_beacon struct nl_msg *msg; struct wpa_driver_nl80211_data *drv = bss->drv; @@ -3548,7 +3747,7 @@ index 076950fe35..656b744aa7 100644 } -@@ -5278,7 +5283,7 @@ static void nl80211_teardown_ap(struct i -+@@ -5601,7 +5606,7 @@ static void nl80211_teardown_ap(struct i ++@@ -5617,7 +5622,7 @@ static void nl80211_teardown_ap(struct i nl80211_mgmt_unsubscribe(bss, "AP teardown"); nl80211_put_wiphy_data_ap(bss); @@ -3557,7 +3756,7 @@ index 076950fe35..656b744aa7 100644 -@@ -7694,8 +7699,6 @@ static int wpa_driver_nl80211_if_remove( -+@@ -8048,8 +8053,6 @@ static int wpa_driver_nl80211_if_remove( ++@@ -8071,8 +8076,6 @@ static int wpa_driver_nl80211_if_remove( } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); @@ -3566,7 +3765,7 @@ index 076950fe35..656b744aa7 100644 if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -8089,7 +8092,6 @@ static int wpa_driver_nl80211_deinit_ap( -+@@ -8446,7 +8449,6 @@ static int wpa_driver_nl80211_deinit_ap( ++@@ -8469,7 +8472,6 @@ static int wpa_driver_nl80211_deinit_ap( if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); @@ -3575,12 +3774,12 @@ index 076950fe35..656b744aa7 100644 /* * If the P2P GO interface was dynamically added, then it is -@@ -8109,7 +8111,6 @@ static int wpa_driver_nl80211_stop_ap(vo -+@@ -8466,7 +8468,6 @@ static int wpa_driver_nl80211_stop_ap(vo ++@@ -8489,7 +8491,6 @@ static int wpa_driver_nl80211_stop_ap(vo if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); diff --git a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch -index 31c5102cb1..349522e06a 100644 +index 31c5102cb1..7f3aa91889 100644 --- a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch +++ b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch @@ -1,6 +1,6 @@ @@ -3614,7 +3813,7 @@ index 31c5102cb1..349522e06a 100644 #ifdef NEED_AP_MLME static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd, -@@ -3546,6 +3603,8 @@ static int hostapd_ctrl_iface_receive_pr -+@@ -3754,6 +3811,8 @@ static int hostapd_ctrl_iface_receive_pr ++@@ -3771,6 +3828,8 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); @@ -3623,12 +3822,12 @@ index 31c5102cb1..349522e06a 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c -@@ -917,7 +917,13 @@ int hostapd_parse_csa_settings(const cha -+@@ -919,7 +919,13 @@ int hostapd_parse_csa_settings(const cha ++@@ -927,7 +927,13 @@ int hostapd_parse_csa_settings(const cha int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd) { diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch -index 1c5f72ddc0..535164d802 100644 +index 1c5f72ddc0..c81c841a43 100644 --- a/package/network/services/hostapd/patches/370-ap_sta_support.patch +++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch @@ -1,17 +1,6 @@ @@ -3691,7 +3890,7 @@ index 1c5f72ddc0..535164d802 100644 #ifdef CONFIG_WEP /* Configure default/group WEP keys for static WEP */ -@@ -991,6 +1039,8 @@ void wpa_supplicant_set_state(struct wpa -+@@ -1007,6 +1055,8 @@ void wpa_supplicant_set_state(struct wpa ++@@ -1015,6 +1063,8 @@ void wpa_supplicant_set_state(struct wpa sme_sched_obss_scan(wpa_s, 1); @@ -3700,7 +3899,7 @@ index 1c5f72ddc0..535164d802 100644 if (!fils_hlp_sent && ssid && ssid->eap.erp) update_fils_connect_params = true; -@@ -1001,6 +1051,8 @@ void wpa_supplicant_set_state(struct wpa -+@@ -1017,6 +1067,8 @@ void wpa_supplicant_set_state(struct wpa ++@@ -1025,6 +1075,8 @@ void wpa_supplicant_set_state(struct wpa #endif /* CONFIG_OWE */ } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING || state == WPA_ASSOCIATED) { @@ -3709,7 +3908,7 @@ index 1c5f72ddc0..535164d802 100644 wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -2225,6 +2277,8 @@ void wpa_supplicant_associate(struct wpa -+@@ -2276,6 +2328,8 @@ void wpa_supplicant_associate(struct wpa ++@@ -2308,6 +2360,8 @@ void wpa_supplicant_associate(struct wpa return; } wpa_s->current_bss = bss; @@ -3718,7 +3917,7 @@ index 1c5f72ddc0..535164d802 100644 wpa_msg(wpa_s, MSG_ERROR, "mesh mode support not included in the build"); -@@ -6207,6 +6261,16 @@ static int wpa_supplicant_init_iface(str -+@@ -6426,6 +6480,16 @@ static int wpa_supplicant_init_iface(str ++@@ -6650,6 +6704,16 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } @@ -3727,11 +3926,11 @@ index 1c5f72ddc0..535164d802 100644 eapol_sm_notify_portEnabled(wpa_s->eapol, false); eapol_sm_notify_portValid(wpa_s->eapol, false); -@@ -6540,6 +6604,11 @@ static void wpa_supplicant_deinit_iface( -+@@ -6763,6 +6827,11 @@ static void wpa_supplicant_deinit_iface( ++@@ -6987,6 +7051,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); -@@ -218,12 +207,12 @@ +@@ -218,9 +207,9 @@ + wpa_s->hostapd = NULL; + } + @@ -3743,17 +3942,13 @@ index 1c5f72ddc0..535164d802 100644 + --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h --@@ -104,6 +104,11 @@ struct wpa_interface { -+@@ -103,6 +103,11 @@ struct wpa_interface { - const char *ifname; - - /** + @@ -104,6 +104,11 @@ struct wpa_interface { @@ -235,7 +224,7 @@ * bridge_ifname - Optional bridge interface name * * If the driver interface (ifname) is included in a Linux bridge -@@ -530,6 +535,8 @@ struct wpa_supplicant { -+@@ -615,6 +620,8 @@ struct wpa_supplicant { ++@@ -718,6 +723,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_BINDER */ char bridge_ifname[16]; @@ -3762,7 +3957,7 @@ index 1c5f72ddc0..535164d802 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2712,6 +2712,11 @@ static int hostapd_ctrl_iface_chan_switc -+@@ -2883,6 +2883,12 @@ static int hostapd_ctrl_iface_chan_switc ++@@ -2889,6 +2889,12 @@ static int hostapd_ctrl_iface_chan_switc return 0; } @@ -3781,7 +3976,7 @@ index 1c5f72ddc0..535164d802 100644 -@@ -1468,11 +1468,6 @@ int ieee802_11_set_beacon(struct hostapd - struct wpabuf *beacon, *proberesp, *assocresp; - int res, ret = -1; -+@@ -1758,11 +1758,6 @@ int ieee802_11_set_beacon(struct hostapd ++@@ -1791,11 +1791,6 @@ static int __ieee802_11_set_beacon(struc + return -1; + } @@ -3792,7 +3987,7 @@ index 1c5f72ddc0..535164d802 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4579,6 +4579,60 @@ static void wpas_event_unprot_beacon(str -+@@ -4665,6 +4665,60 @@ static void wpas_event_unprot_beacon(str ++@@ -4891,6 +4891,60 @@ static void wpas_event_unprot_beacon(str } @@ -3801,7 +3996,7 @@ index 1c5f72ddc0..535164d802 100644 union wpa_event_data *data) { -@@ -4881,8 +4935,10 @@ void supplicant_event(void *ctx, enum wp -+@@ -4980,8 +5034,10 @@ void supplicant_event(void *ctx, enum wp ++@@ -5206,8 +5260,10 @@ void supplicant_event(void *ctx, enum wp channel_width_to_string(data->ch_switch.ch_width), data->ch_switch.cf1, data->ch_switch.cf2); @@ -3810,7 +4005,7 @@ index 1c5f72ddc0..535164d802 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5690,6 +5690,7 @@ union wpa_event_data { -+@@ -5829,6 +5829,7 @@ union wpa_event_data { ++@@ -5837,6 +5837,7 @@ union wpa_event_data { /** * struct ch_switch @@ -3819,7 +4014,7 @@ index 1c5f72ddc0..535164d802 100644 * @ht_enabled: Whether this is an HT channel * @ch_offset: Secondary channel offset -@@ -5698,6 +5699,7 @@ union wpa_event_data { -+@@ -5837,6 +5838,7 @@ union wpa_event_data { ++@@ -5845,6 +5846,7 @@ union wpa_event_data { * @cf2: Center frequency 2 */ struct ch_switch { @@ -3860,7 +4055,7 @@ index 1c5f72ddc0..535164d802 100644 tb[NL80211_ATTR_CENTER_FREQ1], tb[NL80211_ATTR_CENTER_FREQ2], diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch -index b98b2d0cba..81f7aa4952 100644 +index b98b2d0cba..92b52a6d37 100644 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -1,6 +1,6 @@ @@ -3876,7 +4071,7 @@ index b98b2d0cba..81f7aa4952 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3370,6 +3370,7 @@ static int hostapd_ctrl_iface_receive_pr -+@@ -3570,6 +3570,7 @@ static int hostapd_ctrl_iface_receive_pr ++@@ -3587,6 +3587,7 @@ static int hostapd_ctrl_iface_receive_pr reply_size); } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { reply_len = hostapd_drv_status(hapd, reply, reply_size); @@ -3885,7 +4080,7 @@ index b98b2d0cba..81f7aa4952 100644 reply_len = ieee802_11_get_mib(hapd, reply, reply_size); if (reply_len >= 0) { -@@ -3411,6 +3412,7 @@ static int hostapd_ctrl_iface_receive_pr -+@@ -3611,6 +3612,7 @@ static int hostapd_ctrl_iface_receive_pr ++@@ -3628,6 +3629,7 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); @@ -3894,7 +4089,7 @@ index b98b2d0cba..81f7aa4952 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -952,6 +952,9 @@ ifdef CONFIG_FILS -+@@ -956,6 +956,9 @@ ifdef CONFIG_FILS ++@@ -958,6 +958,9 @@ ifdef CONFIG_FILS OBJS += ../src/ap/fils_hlp.o endif ifdef CONFIG_CTRL_IFACE @@ -3903,7 +4098,7 @@ index b98b2d0cba..81f7aa4952 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -2267,7 +2267,7 @@ static int wpa_supplicant_ctrl_iface_sta -+@@ -2308,7 +2308,7 @@ static int wpa_supplicant_ctrl_iface_sta ++@@ -2314,7 +2314,7 @@ static int wpa_supplicant_ctrl_iface_sta pos += ret; } @@ -3912,7 +4107,7 @@ index b98b2d0cba..81f7aa4952 100644 pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -10366,6 +10366,7 @@ char * wpa_supplicant_ctrl_iface_process -+@@ -10919,6 +10919,7 @@ char * wpa_supplicant_ctrl_iface_process ++@@ -11494,6 +11494,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -3921,7 +4116,7 @@ index b98b2d0cba..81f7aa4952 100644 reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -10378,6 +10379,7 @@ char * wpa_supplicant_ctrl_iface_process -+@@ -10931,6 +10932,7 @@ char * wpa_supplicant_ctrl_iface_process ++@@ -11506,6 +11507,7 @@ char * wpa_supplicant_ctrl_iface_process reply_size - reply_len); #endif /* CONFIG_MACSEC */ } @@ -3930,7 +4125,7 @@ index b98b2d0cba..81f7aa4952 100644 reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -10862,6 +10864,7 @@ char * wpa_supplicant_ctrl_iface_process -+@@ -11419,6 +11421,7 @@ char * wpa_supplicant_ctrl_iface_process ++@@ -11994,6 +11996,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -3939,16 +4134,25 @@ index b98b2d0cba..81f7aa4952 100644 reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -10870,12 +10873,15 @@ char * wpa_supplicant_ctrl_iface_process -+@@ -11427,12 +11430,15 @@ char * wpa_supplicant_ctrl_iface_process ++@@ -12002,12 +12005,15 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); +@@ -101,7 +101,7 @@ + + static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen, + size_t curr_len, const u8 *mcs_set) +-@@ -451,6 +452,7 @@ int hostapd_ctrl_iface_sta_next(struct h ++@@ -459,6 +460,7 @@ int hostapd_ctrl_iface_sta_next(struct h + return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); + } + @@ -109,7 +109,7 @@ #ifdef CONFIG_P2P_MANAGER static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, -@@ -806,12 +808,12 @@ int hostapd_ctrl_iface_status(struct hos -+@@ -807,12 +809,12 @@ int hostapd_ctrl_iface_status(struct hos ++@@ -815,12 +817,12 @@ int hostapd_ctrl_iface_status(struct hos return len; len += ret; } @@ -3993,7 +4197,7 @@ index b98b2d0cba..81f7aa4952 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2728,6 +2728,8 @@ static u32 wpa_key_mgmt_suite(struct wpa -+@@ -2767,6 +2767,8 @@ static u32 wpa_key_mgmt_suite(struct wpa ++@@ -2777,6 +2777,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -4002,7 +4206,7 @@ index b98b2d0cba..81f7aa4952 100644 #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -2809,6 +2811,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch -+@@ -2848,6 +2850,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch ++@@ -2858,6 +2860,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } @@ -4011,7 +4215,7 @@ index b98b2d0cba..81f7aa4952 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1324,7 +1324,7 @@ int wpas_ap_wps_nfc_report_handover(stru -+@@ -1364,7 +1364,7 @@ int wpas_ap_wps_nfc_report_handover(stru ++@@ -1462,7 +1462,7 @@ int wpas_ap_wps_nfc_report_handover(stru #endif /* CONFIG_WPS */ @@ -4036,6 +4240,19 @@ index 9dee2d738e..65a8b07e65 100644 if (ie1 == NULL || ie2 == NULL) return -1; +diff --git a/package/network/services/hostapd/patches/400-wps_single_auth_enc_type.patch b/package/network/services/hostapd/patches/400-wps_single_auth_enc_type.patch +index 73a8c7694d..f708bf39ba 100644 +--- a/package/network/services/hostapd/patches/400-wps_single_auth_enc_type.patch ++++ b/package/network/services/hostapd/patches/400-wps_single_auth_enc_type.patch +@@ -11,7 +11,7 @@ + bss->wpa_pairwise |= WPA_CIPHER_TKIP; + #endif /* CONFIG_NO_TKIP */ + bss->rsn_pairwise = bss->wpa_pairwise; +-@@ -1178,8 +1177,7 @@ int hostapd_init_wps(struct hostapd_data ++@@ -1180,8 +1179,7 @@ int hostapd_init_wps(struct hostapd_data + WPA_CIPHER_GCMP_256)) { + wps->encr_types |= WPS_ENCR_AES; + wps->encr_types_rsn |= WPS_ENCR_AES; diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch index 9f216347f4..f9dff66073 100644 --- a/package/network/services/hostapd/patches/420-indicate-features.patch @@ -4081,7 +4298,7 @@ index 3744464c89..dc1fa3d29d 100644 { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, "= show current WPS status" }, diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch -index 99c552821b..e0e687e161 100644 +index 99c552821b..28f07c7dc2 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -22,7 +22,7 @@ Signed-hostap: Antonio Quartulli @@ -4089,7 +4306,7 @@ index 99c552821b..e0e687e161 100644 #include "common/ieee802_11_defs.h" #include "common/wpa_common.h" -@@ -850,6 +851,9 @@ struct wpa_driver_associate_params { -+@@ -851,6 +852,9 @@ struct wpa_driver_associate_params { ++@@ -857,6 +858,9 @@ struct wpa_driver_associate_params { * responsible for selecting with which BSS to associate. */ const u8 *bssid; @@ -4111,17 +4328,26 @@ index 99c552821b..e0e687e161 100644 { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, +@@ -162,7 +162,7 @@ Signed-hostap: Antonio Quartulli + + + #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1) +-@@ -843,6 +845,9 @@ struct wpa_ssid { ++@@ -846,6 +848,9 @@ struct wpa_ssid { + */ + void *parent_cred; + @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3638,6 +3638,12 @@ static void wpas_start_assoc_cb(struct w -+@@ -3726,6 +3726,12 @@ static void wpas_start_assoc_cb(struct w ++@@ -3865,6 +3865,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch -index b5dec991d0..b3c8b26461 100644 +index b5dec991d0..0be77f9845 100644 --- a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli @@ -4129,7 +4355,7 @@ index b5dec991d0..b3c8b26461 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -5601,7 +5601,7 @@ static int wpa_driver_nl80211_ibss(struc -+@@ -5950,7 +5950,7 @@ static int wpa_driver_nl80211_ibss(struc ++@@ -5966,7 +5966,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -4138,12 +4364,12 @@ index b5dec991d0..b3c8b26461 100644 wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -5628,6 +5628,37 @@ retry: -+@@ -5977,6 +5977,37 @@ retry: ++@@ -5993,6 +5993,37 @@ retry: nl80211_put_beacon_int(msg, params->beacon_int)) goto fail; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch -index 7e21da263d..d9a6e74140 100644 +index 7e21da263d..bd1d4d7565 100644 --- a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -19,17 +19,17 @@ Tested-by: Simon Wunderlich @@ -4151,7 +4377,7 @@ index 7e21da263d..d9a6e74140 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1549,6 +1549,7 @@ struct wpa_driver_mesh_join_params { -+@@ -1618,6 +1618,7 @@ struct wpa_driver_mesh_join_params { ++@@ -1624,6 +1624,7 @@ struct wpa_driver_mesh_join_params { #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 unsigned int flags; - u8 handle_dfs; @@ -4163,7 +4389,7 @@ index 7e21da263d..d9a6e74140 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10058,6 +10058,18 @@ static int nl80211_put_mesh_id(struct nl -+@@ -10473,6 +10473,18 @@ static int nl80211_put_mesh_id(struct nl ++@@ -10496,6 +10496,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -4172,7 +4398,7 @@ index 7e21da263d..d9a6e74140 100644 struct wpa_driver_mesh_bss_params *params) { -@@ -10119,6 +10131,7 @@ static int nl80211_join_mesh(struct i802 -+@@ -10534,6 +10546,7 @@ static int nl80211_join_mesh(struct i802 ++@@ -10557,6 +10569,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || @@ -4181,44 +4407,63 @@ index 7e21da263d..d9a6e74140 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -592,6 +592,7 @@ int wpa_supplicant_join_mesh(struct wpa_ -+@@ -600,6 +600,7 @@ int wpa_supplicant_join_mesh(struct wpa_ ++@@ -631,6 +631,7 @@ int wpa_supplicant_join_mesh(struct wpa_ params->meshid = ssid->ssid; params->meshid_len = ssid->ssid_len; diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch -index 6d48175163..4c7cb9ea36 100644 +index 6d48175163..4807727e0e 100644 --- a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch +++ b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2407,11 +2407,13 @@ void ibss_mesh_setup_freq(struct wpa_sup -+@@ -2457,11 +2457,13 @@ void ibss_mesh_setup_freq(struct wpa_sup ++@@ -2512,11 +2512,13 @@ void ibss_mesh_setup_freq(struct wpa_sup for (j = 0; j < wpa_s->last_scan_res_used; j++) { struct wpa_bss *bss = wpa_s->last_scan_res[j]; diff --git a/package/network/services/hostapd/patches/470-survey_data_fallback.patch b/package/network/services/hostapd/patches/470-survey_data_fallback.patch -index 57a78ee865..efd82599d3 100644 +index 57a78ee865..359b5f3ef8 100644 --- a/package/network/services/hostapd/patches/470-survey_data_fallback.patch +++ b/package/network/services/hostapd/patches/470-survey_data_fallback.patch -@@ -20,7 +20,7 @@ - - total = survey->channel_time; - +@@ -1,26 +1,6 @@ + --- a/src/ap/acs.c + +++ b/src/ap/acs.c +-@@ -302,18 +302,12 @@ static void acs_fail(struct hostapd_ifac +- static long double +- acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf) +- { +-- long double factor, busy, total; +-+ long double factor, busy = 0, total; +- +- if (survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) +- busy = survey->channel_time_busy; +- else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX) +- busy = survey->channel_time_rx; +-- else { +-- /* This shouldn't really happen as survey data is checked in +-- * acs_sanity_check() */ +-- wpa_printf(MSG_ERROR, "ACS: Survey data missing"); +-- return 0; +-- } +- +- total = survey->channel_time; +- -@@ -415,20 +409,19 @@ static int acs_usable_vht160_chan(const -+@@ -422,20 +416,19 @@ static int acs_usable_bw160_chan(const s ++@@ -420,20 +420,19 @@ static int acs_usable_bw160_chan(const s static int acs_survey_is_sufficient(struct freq_survey *survey) { if (!(survey->filled & SURVEY_HAS_NF)) { diff --git a/package/network/services/hostapd/patches/500-lto-jobserver-support.patch b/package/network/services/hostapd/patches/500-lto-jobserver-support.patch -index 46030859de..3f741cdf34 100644 +index 46030859de..c51db01fec 100644 --- a/package/network/services/hostapd/patches/500-lto-jobserver-support.patch +++ b/package/network/services/hostapd/patches/500-lto-jobserver-support.patch @@ -1,16 +1,17 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -1327,14 +1327,14 @@ hostapd_multi.a: $(BCHECK) $(OBJS) -+@@ -1294,7 +1294,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) ++@@ -1297,7 +1297,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) @$(AR) cr $@ hostapd_multi.o $(OBJS) - hostapd: $(BCHECK) $(OBJS) @@ -4230,7 +4475,7 @@ index 46030859de..3f741cdf34 100644 ifdef CONFIG_WPA_TRACE - OBJS_c += ../src/utils/trace.o - endif -+@@ -1305,7 +1305,7 @@ _OBJS_VAR := OBJS_c ++@@ -1308,7 +1308,7 @@ _OBJS_VAR := OBJS_c + include ../src/objs.mk + hostapd_cli: $(OBJS_c) @@ -4241,7 +4486,7 @@ index 46030859de..3f741cdf34 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -1930,23 +1930,23 @@ wpa_supplicant_multi.a: .config $(BCHECK -+@@ -1919,31 +1919,31 @@ wpa_supplicant_multi.a: .config $(BCHECK ++@@ -1920,31 +1920,31 @@ wpa_supplicant_multi.a: .config $(BCHECK @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) @@ -4275,120 +4520,15 @@ index 46030859de..3f741cdf34 100644 wpa_cli: $(OBJS_c) - $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) + +$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) -diff --git a/package/network/services/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch b/package/network/services/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch -new file mode 100644 -index 0000000000..6c080adc0e ---- /dev/null -+++ b/package/network/services/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch -@@ -0,0 +1,99 @@ -+From 1b26807938815d0b0b266caf31d8ef0019607e64 Mon Sep 17 00:00:00 2001 -+From: David Bauer -+Date: Mon, 27 Sep 2021 15:41:48 +0200 -+Subject: [PATCH] WNM: allow specifying dialog-token -+ -+This commit adds the ability to specify the dialog token of a WNM BSS -+Transition request frame via the hostapd control socket. -+ -+FOr this, the new 'dialog_token' option can be used. It accepts values -+as a 8 bit unsigned integer. If not specified, the dialog token is set -+to 1 like before. -+ -+Signed-off-by: David Bauer -+--- -+ hostapd/ctrl_iface.c | 10 ++++++++-- -+ src/ap/wnm_ap.c | 11 ++++++----- -+ src/ap/wnm_ap.h | 4 ++-- -+ 3 files changed, 16 insertions(+), 9 deletions(-) -+ -+--- a/hostapd/ctrl_iface.c -++++ b/hostapd/ctrl_iface.c -+@@ -897,7 +897,7 @@ static int hostapd_ctrl_iface_bss_tm_req -+ const char *pos, *end; -+ int disassoc_timer = 0; -+ struct sta_info *sta; -+- u8 req_mode = 0, valid_int = 0x01; -++ u8 req_mode = 0, valid_int = 0x01, dialog_token = 0x01; -+ u8 bss_term_dur[12]; -+ char *url = NULL; -+ int ret; -+@@ -935,6 +935,12 @@ static int hostapd_ctrl_iface_bss_tm_req -+ valid_int = atoi(pos); -+ } -+ -++ pos = os_strstr(cmd, " dialog_token="); -++ if (pos) { -++ pos += 14; -++ dialog_token = atoi(pos); -++ } -++ -+ pos = os_strstr(cmd, " bss_term="); -+ if (pos) { -+ pos += 10; -+@@ -1041,7 +1047,7 @@ static int hostapd_ctrl_iface_bss_tm_req -+ #endif /* CONFIG_MBO */ -+ -+ ret = wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer, -+- valid_int, bss_term_dur, url, -++ valid_int, bss_term_dur, dialog_token, url, -+ nei_len ? nei_rep : NULL, nei_len, -+ mbo_len ? mbo : NULL, mbo_len); -+ #ifdef CONFIG_MBO -+--- a/src/ap/wnm_ap.c -++++ b/src/ap/wnm_ap.c -+@@ -788,8 +788,8 @@ int wnm_send_ess_disassoc_imminent(struc -+ -+ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta, -+ u8 req_mode, int disassoc_timer, u8 valid_int, -+- const u8 *bss_term_dur, const char *url, -+- const u8 *nei_rep, size_t nei_rep_len, -++ const u8 *bss_term_dur, u8 dialog_token, -++ const char *url, const u8 *nei_rep, size_t nei_rep_len, -+ const u8 *mbo_attrs, size_t mbo_len) -+ { -+ u8 *buf, *pos; -+@@ -797,8 +797,9 @@ int wnm_send_bss_tm_req(struct hostapd_d -+ size_t url_len; -+ -+ wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to " -+- MACSTR " req_mode=0x%x disassoc_timer=%d valid_int=0x%x", -+- MAC2STR(sta->addr), req_mode, disassoc_timer, valid_int); -++ MACSTR " req_mode=0x%x disassoc_timer=%d valid_int=0x%x " -++ "dialog_token=%x", -++ MAC2STR(sta->addr), req_mode, disassoc_timer, valid_int, dialog_token); -+ buf = os_zalloc(1000 + nei_rep_len + mbo_len); -+ if (buf == NULL) -+ return -1; -+@@ -810,7 +811,7 @@ int wnm_send_bss_tm_req(struct hostapd_d -+ os_memcpy(mgmt->bssid, hapd->own_addr, ETH_ALEN); -+ mgmt->u.action.category = WLAN_ACTION_WNM; -+ mgmt->u.action.u.bss_tm_req.action = WNM_BSS_TRANS_MGMT_REQ; -+- mgmt->u.action.u.bss_tm_req.dialog_token = 1; -++ mgmt->u.action.u.bss_tm_req.dialog_token = dialog_token; -+ mgmt->u.action.u.bss_tm_req.req_mode = req_mode; -+ mgmt->u.action.u.bss_tm_req.disassoc_timer = -+ host_to_le16(disassoc_timer); -+--- a/src/ap/wnm_ap.h -++++ b/src/ap/wnm_ap.h -+@@ -20,8 +20,8 @@ int wnm_send_ess_disassoc_imminent(struc -+ int disassoc_timer); -+ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta, -+ u8 req_mode, int disassoc_timer, u8 valid_int, -+- const u8 *bss_term_dur, const char *url, -+- const u8 *nei_rep, size_t nei_rep_len, -++ const u8 *bss_term_dur, u8 dialog_token, -++ const char *url, const u8 *nei_rep, size_t nei_rep_len, -+ const u8 *mbo_attrs, size_t mbo_len); -+ void ap_sta_reset_steer_flag_timer(void *eloop_ctx, void *timeout_ctx); -+ int wnm_send_coloc_intf_req(struct hostapd_data *hapd, struct sta_info *sta, diff --git a/package/network/services/hostapd/patches/590-rrm-wnm-statistics.patch b/package/network/services/hostapd/patches/590-rrm-wnm-statistics.patch new file mode 100644 -index 0000000000..737fdbb5d0 +index 0000000000..ee3ab7938a --- /dev/null +++ b/package/network/services/hostapd/patches/590-rrm-wnm-statistics.patch @@ -0,0 +1,92 @@ +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h -+@@ -148,6 +148,21 @@ struct hostapd_sae_commit_queue { ++@@ -150,6 +150,21 @@ struct hostapd_sae_commit_queue { + }; + + /** @@ -4410,7 +4550,7 @@ index 0000000000..737fdbb5d0 + * struct hostapd_data - hostapd per-BSS data structure + */ + struct hostapd_data { -+@@ -161,6 +176,9 @@ struct hostapd_data { ++@@ -163,6 +178,9 @@ struct hostapd_data { + + u8 own_addr[ETH_ALEN]; + @@ -4459,7 +4599,7 @@ index 0000000000..737fdbb5d0 + if (disassoc_timer) { + /* send disassociation frame after time-out */ + set_disassoc_timer(hapd, sta, disassoc_timer); -+@@ -856,6 +861,7 @@ int wnm_send_bss_tm_req(struct hostapd_d ++@@ -857,6 +862,7 @@ int wnm_send_bss_tm_req(struct hostapd_d + } + os_free(buf); + @@ -4479,7 +4619,7 @@ index 0000000000..737fdbb5d0 + wpabuf_head(buf), wpabuf_len(buf)); + wpabuf_free(buf); diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch -index 53f521e649..b33fe8cda5 100644 +index 53f521e649..6a0acbb318 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -1,6 +1,6 @@ @@ -4495,7 +4635,7 @@ index 53f521e649..b33fe8cda5 100644 enum hostapd_chan_status { -@@ -154,6 +155,7 @@ struct hostapd_data { -+@@ -169,6 +170,7 @@ struct hostapd_data { ++@@ -171,6 +172,7 @@ struct hostapd_data { struct hostapd_iface *iface; struct hostapd_config *iconf; struct hostapd_bss_config *conf; @@ -4504,7 +4644,7 @@ index 53f521e649..b33fe8cda5 100644 unsigned int started:1; unsigned int disabled:1; -@@ -606,6 +608,7 @@ hostapd_alloc_bss_data(struct hostapd_if -+@@ -628,6 +630,7 @@ hostapd_alloc_bss_data(struct hostapd_if ++@@ -630,6 +632,7 @@ hostapd_alloc_bss_data(struct hostapd_if struct hostapd_bss_config *bss); int hostapd_setup_interface(struct hostapd_iface *iface); int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err); @@ -4576,7 +4716,7 @@ index 53f521e649..b33fe8cda5 100644 return; -@@ -4157,7 +4169,7 @@ static void handle_assoc(struct hostapd_ -+@@ -5445,7 +5457,7 @@ static void handle_assoc(struct hostapd_ ++@@ -5447,7 +5459,7 @@ static void handle_assoc(struct hostapd_ int resp = WLAN_STATUS_SUCCESS; - u16 reply_res; + u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE; @@ -4587,7 +4727,7 @@ index 53f521e649..b33fe8cda5 100644 u8 *tmp = NULL; #ifdef CONFIG_FILS -@@ -4370,6 +4382,11 @@ static void handle_assoc(struct hostapd_ -+@@ -5658,6 +5670,11 @@ static void handle_assoc(struct hostapd_ ++@@ -5660,6 +5672,11 @@ static void handle_assoc(struct hostapd_ left = res; } #endif /* CONFIG_FILS */ @@ -4596,7 +4736,7 @@ index 53f521e649..b33fe8cda5 100644 /* followed by SSID and Supported rates; and HT capabilities if 802.11n * is used */ -@@ -4468,6 +4485,14 @@ static void handle_assoc(struct hostapd_ -+@@ -5756,6 +5773,13 @@ static void handle_assoc(struct hostapd_ ++@@ -5758,6 +5775,13 @@ static void handle_assoc(struct hostapd_ } #endif /* CONFIG_FILS */ @@ -4609,7 +4749,7 @@ index 53f521e649..b33fe8cda5 100644 /* -@@ -4561,6 +4586,7 @@ static void handle_disassoc(struct hosta -+@@ -5849,6 +5873,7 @@ static void handle_disassoc(struct hosta ++@@ -5851,6 +5875,7 @@ static void handle_disassoc(struct hosta wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", MAC2STR(mgmt->sa), le_to_host16(mgmt->u.disassoc.reason_code)); @@ -4620,7 +4760,7 @@ index 53f521e649..b33fe8cda5 100644 -@@ -4627,6 +4653,8 @@ static void handle_deauth(struct hostapd - " reason_code=%d", - MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code)); -+@@ -5918,6 +5943,8 @@ static void handle_deauth(struct hostapd ++@@ -5920,6 +5945,8 @@ static void handle_deauth(struct hostapd + /* Clear the PTKSA cache entries for PASN */ + ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE); @@ -4631,7 +4771,7 @@ index 53f521e649..b33fe8cda5 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -814,6 +814,12 @@ void handle_probe_req(struct hostapd_dat -+@@ -823,6 +823,12 @@ void handle_probe_req(struct hostapd_dat ++@@ -852,6 +852,12 @@ void handle_probe_req(struct hostapd_dat u16 csa_offs[2]; size_t csa_offs_len; struct radius_sta rad_info; @@ -4644,7 +4784,7 @@ index 53f521e649..b33fe8cda5 100644 -@@ -996,6 +1002,12 @@ void handle_probe_req(struct hostapd_dat + if (hapd->iconf->rssi_ignore_probe_request && ssi_signal && + ssi_signal < hapd->iconf->rssi_ignore_probe_request) -+@@ -1009,6 +1015,12 @@ void handle_probe_req(struct hostapd_dat ++@@ -1038,6 +1044,12 @@ void handle_probe_req(struct hostapd_dat } #endif /* CONFIG_P2P */ @@ -4716,7 +4856,7 @@ index 53f521e649..b33fe8cda5 100644 CFLAGS += -O0 -fprofile-arcs -ftest-coverage LIBS += -lgcov -@@ -956,6 +962,9 @@ ifdef CONFIG_CTRL_IFACE_MIB -+@@ -960,6 +966,9 @@ ifdef CONFIG_CTRL_IFACE_MIB ++@@ -962,6 +968,9 @@ ifdef CONFIG_CTRL_IFACE_MIB CFLAGS += -DCONFIG_CTRL_IFACE_MIB endif OBJS += ../src/ap/ctrl_iface_ap.o @@ -4725,7 +4865,7 @@ index 53f521e649..b33fe8cda5 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -6794,6 +6794,8 @@ struct wpa_supplicant * wpa_supplicant_a -+@@ -7017,6 +7017,8 @@ struct wpa_supplicant * wpa_supplicant_a ++@@ -7241,6 +7241,8 @@ struct wpa_supplicant * wpa_supplicant_a } #endif /* CONFIG_P2P */ @@ -4734,7 +4874,7 @@ index 53f521e649..b33fe8cda5 100644 } -@@ -6820,6 +6822,8 @@ int wpa_supplicant_remove_iface(struct w -+@@ -7043,6 +7045,8 @@ int wpa_supplicant_remove_iface(struct w ++@@ -7267,6 +7269,8 @@ int wpa_supplicant_remove_iface(struct w struct wpa_supplicant *parent = wpa_s->parent; #endif /* CONFIG_MESH */ @@ -4743,7 +4883,7 @@ index 53f521e649..b33fe8cda5 100644 prev = global->ifaces; if (prev == wpa_s) { -@@ -7123,8 +7127,12 @@ int wpa_supplicant_run(struct wpa_global -+@@ -7346,8 +7350,12 @@ int wpa_supplicant_run(struct wpa_global ++@@ -7570,8 +7574,12 @@ int wpa_supplicant_run(struct wpa_global eloop_register_signal_terminate(wpa_supplicant_terminate, global); eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); @@ -4761,7 +4901,7 @@ index 53f521e649..b33fe8cda5 100644 extern const char *const wpa_supplicant_version; extern const char *const wpa_supplicant_license; -@@ -310,6 +311,8 @@ struct wpa_global { -+@@ -321,6 +322,8 @@ struct wpa_global { ++@@ -322,6 +323,8 @@ struct wpa_global { #endif /* CONFIG_WIFI_DISPLAY */ struct psk_list_entry *add_psk; /* From group formation */ @@ -4770,10 +4910,19 @@ index 53f521e649..b33fe8cda5 100644 -@@ -520,6 +523,7 @@ struct wpa_supplicant { -+@@ -605,6 +608,7 @@ struct wpa_supplicant { ++@@ -708,6 +711,7 @@ struct wpa_supplicant { unsigned char own_addr[ETH_ALEN]; unsigned char perm_addr[ETH_ALEN]; char ifname[100]; +@@ -364,7 +363,7 @@ + + + #ifndef WPS_PIN_SCAN_IGNORE_SEL_REG +-@@ -392,6 +393,8 @@ static int wpa_supplicant_wps_cred(void ++@@ -393,6 +394,8 @@ static int wpa_supplicant_wps_cred(void + wpa_hexdump_key(MSG_DEBUG, "WPS: Received Credential attribute", + cred->cred_attr, cred->cred_attr_len); + @@ -375,7 +374,7 @@ --- a/hostapd/main.c @@ -4836,7 +4985,7 @@ index 53f521e649..b33fe8cda5 100644 + +--- a/src/ap/dfs.c ++++ b/src/ap/dfs.c -+@@ -1193,6 +1193,8 @@ int hostapd_dfs_radar_detected(struct ho ++@@ -1196,6 +1196,8 @@ int hostapd_dfs_radar_detected(struct ho + "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", + freq, ht_enabled, chan_offset, chan_width, cf1, cf2); + @@ -4966,14 +5115,14 @@ index 0000000000..a03fcc9f92 + lchown(ctrl->local.sun_path, -1, AID_WIFI); + lchown(ctrl->local.sun_path, AID_SYSTEM, AID_WIFI); diff --git a/package/network/services/hostapd/patches/700-wifi-reload.patch b/package/network/services/hostapd/patches/700-wifi-reload.patch -index ceb92265dd..29ac5923df 100644 +index ceb92265dd..e6d7c2f673 100644 --- a/package/network/services/hostapd/patches/700-wifi-reload.patch +++ b/package/network/services/hostapd/patches/700-wifi-reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2501,6 +2501,8 @@ static int hostapd_config_fill(struct ho -+@@ -2453,6 +2453,8 @@ static int hostapd_config_fill(struct ho ++@@ -2458,6 +2458,8 @@ static int hostapd_config_fill(struct ho bss->isolate = atoi(pos); } else if (os_strcmp(buf, "ap_max_inactivity") == 0) { bss->ap_max_inactivity = atoi(pos); @@ -4982,7 +5131,7 @@ index ceb92265dd..29ac5923df 100644 bss->skip_inactivity_poll = atoi(pos); } else if (os_strcmp(buf, "country_code") == 0) { -@@ -3197,6 +3199,8 @@ static int hostapd_config_fill(struct ho -+@@ -3153,6 +3155,8 @@ static int hostapd_config_fill(struct ho ++@@ -3158,6 +3160,8 @@ static int hostapd_config_fill(struct ho } } else if (os_strcmp(buf, "acs_exclude_dfs") == 0) { conf->acs_exclude_dfs = atoi(pos); @@ -4991,7 +5140,7 @@ index ceb92265dd..29ac5923df 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -780,6 +780,7 @@ void hostapd_config_free_bss(struct host -+@@ -791,6 +791,7 @@ void hostapd_config_free_bss(struct host ++@@ -792,6 +792,7 @@ void hostapd_config_free_bss(struct host os_free(conf->radius_req_attr_sqlite); os_free(conf->rsn_preauth_interfaces); os_free(conf->ctrl_interface); @@ -5000,7 +5149,7 @@ index ceb92265dd..29ac5923df 100644 os_free(conf->server_cert); os_free(conf->server_cert2); -@@ -972,6 +973,7 @@ void hostapd_config_free(struct hostapd_ -+@@ -987,6 +988,7 @@ void hostapd_config_free(struct hostapd_ ++@@ -988,6 +989,7 @@ void hostapd_config_free(struct hostapd_ for (i = 0; i < conf->num_bss; i++) hostapd_config_free_bss(conf->bss[i]); @@ -5027,7 +5176,7 @@ index ceb92265dd..29ac5923df 100644 - #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1) - #endif /* CONFIG_AIRTIME_POLICY */ + unsigned int logger_syslog; /* module bitfield */ -+@@ -938,6 +940,7 @@ struct spatial_reuse { ++@@ -942,6 +944,7 @@ struct spatial_reuse { + struct hostapd_config { + struct hostapd_bss_config **bss, *last_bss; + size_t num_bss; @@ -5094,7 +5243,7 @@ index ceb92265dd..29ac5923df 100644 int (*ctrl_iface_init)(struct hostapd_data *hapd); void (*ctrl_iface_deinit)(struct hostapd_data *hapd); -@@ -156,6 +156,7 @@ struct hostapd_data { -+@@ -171,6 +171,7 @@ struct hostapd_data { ++@@ -173,6 +173,7 @@ struct hostapd_data { struct hostapd_config *iconf; struct hostapd_bss_config *conf; struct hostapd_ubus_bss ubus; @@ -5103,7 +5252,7 @@ index ceb92265dd..29ac5923df 100644 unsigned int started:1; unsigned int disabled:1; -@@ -600,7 +601,7 @@ struct hostapd_iface { -+@@ -622,7 +623,7 @@ struct hostapd_iface { ++@@ -624,7 +625,7 @@ struct hostapd_iface { int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx); @@ -5112,7 +5261,7 @@ index ceb92265dd..29ac5923df 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4508,6 +4508,9 @@ static int wpa_driver_nl80211_set_ap(voi -+@@ -4817,6 +4817,9 @@ static int wpa_driver_nl80211_set_ap(voi ++@@ -4833,6 +4833,9 @@ static int wpa_driver_nl80211_set_ap(voi if (ret) { wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)", ret, strerror(-ret)); @@ -5126,7 +5275,7 @@ index ceb92265dd..29ac5923df 100644 reload_opts = txt; diff --git a/package/network/services/hostapd/patches/710-vlan_no_bridge.patch b/package/network/services/hostapd/patches/710-vlan_no_bridge.patch -index 7de4e2c1d4..73db32e54a 100644 +index 7de4e2c1d4..856dc8ba88 100644 --- a/package/network/services/hostapd/patches/710-vlan_no_bridge.patch +++ b/package/network/services/hostapd/patches/710-vlan_no_bridge.patch @@ -10,19 +10,27 @@ @@ -5161,67 +5310,31 @@ index 7de4e2c1d4..73db32e54a 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3400,6 +3400,8 @@ static int hostapd_config_fill(struct ho -+@@ -3366,6 +3366,8 @@ static int hostapd_config_fill(struct ho ++@@ -3381,6 +3381,8 @@ static int hostapd_config_fill(struct ho #ifndef CONFIG_NO_VLAN } else if (os_strcmp(buf, "dynamic_vlan") == 0) { bss->ssid.dynamic_vlan = atoi(pos); diff --git a/package/network/services/hostapd/patches/711-wds_bridge_force.patch b/package/network/services/hostapd/patches/711-wds_bridge_force.patch -index 01507b6d36..d3f8864a74 100644 +index 01507b6d36..a22580c357 100644 --- a/package/network/services/hostapd/patches/711-wds_bridge_force.patch +++ b/package/network/services/hostapd/patches/711-wds_bridge_force.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2405,6 +2405,8 @@ static int hostapd_config_fill(struct ho -+@@ -2357,6 +2357,8 @@ static int hostapd_config_fill(struct ho ++@@ -2358,6 +2358,8 @@ static int hostapd_config_fill(struct ho sizeof(conf->bss[0]->iface)); } else if (os_strcmp(buf, "bridge") == 0) { os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); -diff --git a/package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch b/package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch -new file mode 100644 -index 0000000000..3ef19e5298 ---- /dev/null -+++ b/package/network/services/hostapd/patches/720-ACS-fix-channel-100-frequency.patch -@@ -0,0 +1,30 @@ -+From 5a24286ed6315e1fef755ca1970792554f59b1fc Mon Sep 17 00:00:00 2001 -+From: David Bauer -+Date: Wed, 26 May 2021 22:15:35 +0200 -+Subject: [PATCH] ACS: fix channel 100 frequency -+ -+Channel 100 is a valid channel to choose for 80MHz operation. However, -+it's assigned to 5500 MHz, not 5550MHz. In fact, there is no channel -+assigned to this frequency. -+ -+Fix this obbvious typo to allow ACS to select channel 100 for 80 MHz -+operation again. -+ -+Fixes commit bef5eee4f7b2 ("Convert channel to frequency based selection for AP mode ACS") -+ -+Signed-off-by: David Bauer -+--- -+ src/ap/acs.c | 2 +- -+ 1 file changed, 1 insertion(+), 1 deletion(-) -+ -+--- a/src/ap/acs.c -++++ b/src/ap/acs.c -+@@ -386,7 +386,7 @@ static int acs_usable_bw40_chan(const st -+ -+ static int acs_usable_bw80_chan(const struct hostapd_channel_data *chan) -+ { -+- const int allowed[] = { 5180, 5260, 5550, 5580, 5660, 5745, 5955, 6035, -++ const int allowed[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, 6035, -+ 6115, 6195, 6275, 6355, 6435, 6515, 6595, 6675, -+ 6755, 6835, 6915, 6995 }; -+ unsigned int i; diff --git a/package/network/services/hostapd/patches/720-iface_max_num_sta.patch b/package/network/services/hostapd/patches/720-iface_max_num_sta.patch new file mode 100644 -index 0000000000..3778357ac6 +index 0000000000..106f9d7407 --- /dev/null +++ b/package/network/services/hostapd/patches/720-iface_max_num_sta.patch @@ -0,0 +1,82 @@ +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c -+@@ -2875,6 +2875,14 @@ static int hostapd_config_fill(struct ho ++@@ -2880,6 +2880,14 @@ static int hostapd_config_fill(struct ho + line, bss->max_num_sta, MAX_STA_COUNT); + return 1; + } @@ -5238,7 +5351,7 @@ index 0000000000..3778357ac6 + } else if (os_strcmp(buf, "extended_key_id") == 0) { +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h -+@@ -666,6 +666,7 @@ void hostapd_cleanup_cs_params(struct ho ++@@ -668,6 +668,7 @@ void hostapd_cleanup_cs_params(struct ho + void hostapd_periodic_iface(struct hostapd_iface *iface); + int hostapd_owe_trans_get_info(struct hostapd_data *hapd); + void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx); @@ -5281,7 +5394,7 @@ index 0000000000..3778357ac6 + struct hapd_interfaces *interfaces = iface->interfaces; +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c -+@@ -1039,7 +1039,7 @@ void handle_probe_req(struct hostapd_dat ++@@ -1068,7 +1068,7 @@ void handle_probe_req(struct hostapd_dat + if (hapd->conf->no_probe_resp_if_max_sta && + is_multicast_ether_addr(mgmt->da) && + is_multicast_ether_addr(mgmt->bssid) && @@ -5292,7 +5405,7 @@ index 0000000000..3778357ac6 + " since no room for additional STA", +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h -+@@ -976,6 +976,8 @@ struct hostapd_config { ++@@ -981,6 +981,8 @@ struct hostapd_config { + unsigned int track_sta_max_num; + unsigned int track_sta_max_age; + @@ -5302,14 +5415,14 @@ index 0000000000..3778357ac6 + * ISO/IEC 3166-1. Third octet: + * ' ' (ascii 32): all environments diff --git a/package/network/services/hostapd/patches/730-ft_iface.patch b/package/network/services/hostapd/patches/730-ft_iface.patch -index c1adf1ffcf..0a1a16d6e3 100644 +index c1adf1ffcf..b5809222d7 100644 --- a/package/network/services/hostapd/patches/730-ft_iface.patch +++ b/package/network/services/hostapd/patches/730-ft_iface.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3069,6 +3069,8 @@ static int hostapd_config_fill(struct ho -+@@ -3033,6 +3033,8 @@ static int hostapd_config_fill(struct ho ++@@ -3038,6 +3038,8 @@ static int hostapd_config_fill(struct ho wpa_printf(MSG_INFO, "Line %d: Obsolete peerkey parameter ignored", line); #ifdef CONFIG_IEEE80211R_AP @@ -5327,12 +5440,12 @@ index c1adf1ffcf..0a1a16d6e3 100644 --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c -@@ -1511,8 +1511,12 @@ int hostapd_setup_wpa(struct hostapd_dat -+@@ -1565,8 +1565,12 @@ int hostapd_setup_wpa(struct hostapd_dat ++@@ -1566,8 +1566,12 @@ int hostapd_setup_wpa(struct hostapd_dat wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) { const char *ft_iface; diff --git a/package/network/services/hostapd/patches/740-snoop_iface.patch b/package/network/services/hostapd/patches/740-snoop_iface.patch -index 15aaf4b8e4..d206ed7322 100644 +index 15aaf4b8e4..2ed73750ca 100644 --- a/package/network/services/hostapd/patches/740-snoop_iface.patch +++ b/package/network/services/hostapd/patches/740-snoop_iface.patch @@ -1,6 +1,6 @@ @@ -5348,76 +5461,19 @@ index 15aaf4b8e4..d206ed7322 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2407,6 +2407,8 @@ static int hostapd_config_fill(struct ho -+@@ -2359,6 +2359,8 @@ static int hostapd_config_fill(struct ho ++@@ -2360,6 +2360,8 @@ static int hostapd_config_fill(struct ho os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); if (!bss->wds_bridge[0]) os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); -diff --git a/package/network/services/hostapd/patches/741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch b/package/network/services/hostapd/patches/741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch -new file mode 100644 -index 0000000000..657ef5f2ed ---- /dev/null -+++ b/package/network/services/hostapd/patches/741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch -@@ -0,0 +1,51 @@ -+From ad694836b2ded6b97b426bf331627537cdbff591 Mon Sep 17 00:00:00 2001 -+From: David Bauer -+Date: Thu, 19 Aug 2021 00:52:04 +0200 -+Subject: [PATCH] proxyarp: fix compilation with Hotspot 2.0 disabled -+ -+The disable_dgaf config fiels is only available in case Hostapd is -+compiled with Hotspot 2.0 support, however Proxy-ARP does not depend on -+Hotspot 2.0. -+ -+Only add the code related to this config field when Hotspot 2.0 is -+enabled to fix compilation with the aformentioned preconditions. -+ -+Signed-off-by: David Bauer -+--- -+ src/ap/dhcp_snoop.c | 2 ++ -+ src/ap/ndisc_snoop.c | 2 ++ -+ 2 files changed, 4 insertions(+) -+ -+--- a/src/ap/dhcp_snoop.c -++++ b/src/ap/dhcp_snoop.c -+@@ -88,6 +88,7 @@ static void handle_dhcp(void *ctx, const -+ } -+ } -+ -++#ifdef CONFIG_HS20 -+ if (hapd->conf->disable_dgaf && is_broadcast_ether_addr(buf)) { -+ for (sta = hapd->sta_list; sta; sta = sta->next) { -+ if (!(sta->flags & WLAN_STA_AUTHORIZED)) -+@@ -96,6 +97,7 @@ static void handle_dhcp(void *ctx, const -+ (u8 *) buf, len); -+ } -+ } -++#endif -+ -+ if (msgtype == DHCPACK) { -+ if (b->your_ip == 0) -+--- a/src/ap/ndisc_snoop.c -++++ b/src/ap/ndisc_snoop.c -+@@ -151,10 +151,12 @@ static void handle_ndisc(void *ctx, cons -+ return; -+ } -+ break; -++#ifdef CONFIG_HS20 -+ case ROUTER_ADVERTISEMENT: -+ if (hapd->conf->disable_dgaf) -+ ucast_to_stas(hapd, buf, len); -+ break; -++#endif -+ case NEIGHBOR_ADVERTISEMENT: -+ if (hapd->conf->na_mcast_to_ucast) -+ ucast_to_stas(hapd, buf, len); diff --git a/package/network/services/hostapd/patches/750-qos_map_set_without_interworking.patch b/package/network/services/hostapd/patches/750-qos_map_set_without_interworking.patch -index 94f4a2b297..a7a221352f 100644 +index 94f4a2b297..43a4ea73b3 100644 --- a/package/network/services/hostapd/patches/750-qos_map_set_without_interworking.patch +++ b/package/network/services/hostapd/patches/750-qos_map_set_without_interworking.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -1711,6 +1711,8 @@ static int parse_anqp_elem(struct hostap -+@@ -1643,6 +1643,8 @@ static int parse_anqp_elem(struct hostap ++@@ -1644,6 +1644,8 @@ static int parse_anqp_elem(struct hostap return 0; } @@ -5426,7 +5482,7 @@ index 94f4a2b297..a7a221352f 100644 static int parse_qos_map_set(struct hostapd_bss_config *bss, char *buf, int line) -@@ -1752,8 +1754,6 @@ static int parse_qos_map_set(struct host -+@@ -1684,8 +1686,6 @@ static int parse_qos_map_set(struct host ++@@ -1685,8 +1687,6 @@ static int parse_qos_map_set(struct host return 0; } @@ -5435,7 +5491,7 @@ index 94f4a2b297..a7a221352f 100644 #ifdef CONFIG_HS20 static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, -@@ -4050,10 +4050,10 @@ static int hostapd_config_fill(struct ho -+@@ -4058,10 +4058,10 @@ static int hostapd_config_fill(struct ho ++@@ -4077,10 +4077,10 @@ static int hostapd_config_fill(struct ho bss->gas_frag_limit = val; } else if (os_strcmp(buf, "gas_comeback_delay") == 0) { bss->gas_comeback_delay = atoi(pos); @@ -5471,7 +5527,7 @@ index 94f4a2b297..a7a221352f 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2875,13 +2875,11 @@ static u16 copy_supp_rates(struct hostap -+@@ -4127,13 +4127,11 @@ static u16 copy_supp_rates(struct hostap ++@@ -4129,13 +4129,11 @@ static u16 copy_supp_rates(struct hostap static u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta, const u8 *ext_capab_ie, size_t ext_capab_ie_len) { @@ -5480,7 +5536,7 @@ index 94f4a2b297..a7a221352f 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -2500,8 +2500,6 @@ void wnm_bss_keep_alive_deinit(struct wp -+@@ -2535,8 +2535,6 @@ void wnm_bss_keep_alive_deinit(struct wp ++@@ -2540,8 +2540,6 @@ void wnm_bss_keep_alive_deinit(struct wp } @@ -5489,7 +5545,7 @@ index 94f4a2b297..a7a221352f 100644 size_t len) { -@@ -2534,8 +2532,6 @@ static void interworking_process_assoc_r -+@@ -2569,8 +2567,6 @@ static void interworking_process_assoc_r ++@@ -2574,8 +2572,6 @@ static void interworking_process_assoc_r } } @@ -5498,7 +5554,7 @@ index 94f4a2b297..a7a221352f 100644 static void multi_ap_process_assoc_resp(struct wpa_supplicant *wpa_s, const u8 *ies, size_t ies_len) -@@ -2669,10 +2665,8 @@ static int wpa_supplicant_event_associnf -+@@ -2704,10 +2700,8 @@ static int wpa_supplicant_event_associnf ++@@ -2908,10 +2904,8 @@ static int wpa_supplicant_event_associnf wnm_process_assoc_resp(wpa_s, data->assoc_info.resp_ies, data->assoc_info.resp_ies_len); #endif /* CONFIG_WNM */ @@ -5603,18 +5659,27 @@ index 944f7d71c9..0000000000 - dev->info.wps_sec_dev_type_list_len); - } diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c -index 0575fe2572..bcb80f4a33 100644 +index 0575fe2572..fdc2a3fd26 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c -@@ -21,6 +21,7 @@ +@@ -11,6 +11,7 @@ + #include "utils/eloop.h" + #include "utils/wpabuf.h" + #include "common/ieee802_11_defs.h" ++#include "common/hw_features_common.h" + #include "hostapd.h" + #include "neighbor_db.h" + #include "wps_hostapd.h" +@@ -21,6 +22,8 @@ #include "rrm.h" #include "wnm_ap.h" #include "taxonomy.h" +#include "airtime_policy.h" ++#include "hw_features.h" static struct ubus_context *ctx; static struct blob_buf b; -@@ -297,6 +298,7 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj, +@@ -297,6 +300,7 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj, { "wmm", WLAN_STA_WMM }, { "ht", WLAN_STA_HT }, { "vht", WLAN_STA_VHT }, @@ -5622,7 +5687,7 @@ index 0575fe2572..bcb80f4a33 100644 { "wps", WLAN_STA_WPS }, { "mfp", WLAN_STA_MFP }, }; -@@ -372,24 +374,74 @@ hostapd_bss_get_features(struct ubus_context *ctx, struct ubus_object *obj, +@@ -372,24 +376,81 @@ hostapd_bss_get_features(struct ubus_context *ctx, struct ubus_object *obj, return 0; } @@ -5665,9 +5730,15 @@ index 0575fe2572..bcb80f4a33 100644 char phy_name[17]; - char mac_buf[20]; + size_t ssid_len = SSID_MAX_LEN; ++ u8 channel = 0, op_class = 0; + + if (hapd->conf->ssid.ssid_len < SSID_MAX_LEN) + ssid_len = hapd->conf->ssid.ssid_len; ++ ++ ieee80211_freq_to_channel_ext(hapd->iface->freq, ++ hapd->iconf->secondary_channel, ++ hostapd_get_oper_chwidth(hapd->iconf), ++ &op_class, &channel); blob_buf_init(&b, 0); blobmsg_add_string(&b, "status", hostapd_state_text(hapd->iface->state)); @@ -5678,7 +5749,8 @@ index 0575fe2572..bcb80f4a33 100644 + blobmsg_add_string(&b, "ssid", ssid); + blobmsg_add_u32(&b, "freq", hapd->iface->freq); -+ blobmsg_add_u32(&b, "channel", ieee80211_frequency_to_channel(hapd->iface->freq)); ++ blobmsg_add_u32(&b, "channel", channel); ++ blobmsg_add_u32(&b, "op_class", op_class); + blobmsg_add_u32(&b, "beacon_interval", hapd->iconf->beacon_int); snprintf(phy_name, 17, "%s", hapd->iface->phy); @@ -5699,7 +5771,7 @@ index 0575fe2572..bcb80f4a33 100644 /* Airtime */ airtime_table = blobmsg_open_table(&b, "airtime"); blobmsg_add_u64(&b, "time", hapd->iface->last_channel_time); -@@ -703,7 +755,9 @@ enum { +@@ -703,7 +764,9 @@ enum { CSA_SEC_CHANNEL_OFFSET, CSA_HT, CSA_VHT, @@ -5709,7 +5781,7 @@ index 0575fe2572..bcb80f4a33 100644 __CSA_MAX }; -@@ -716,9 +770,20 @@ static const struct blobmsg_policy csa_policy[__CSA_MAX] = { +@@ -716,9 +779,20 @@ static const struct blobmsg_policy csa_policy[__CSA_MAX] = { [CSA_SEC_CHANNEL_OFFSET] = { "sec_channel_offset", BLOBMSG_TYPE_INT32 }, [CSA_HT] = { "ht", BLOBMSG_TYPE_BOOL }, [CSA_VHT] = { "vht", BLOBMSG_TYPE_BOOL }, @@ -5730,13 +5802,14 @@ index 0575fe2572..bcb80f4a33 100644 #ifdef NEED_AP_MLME static int hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, -@@ -727,14 +792,39 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, +@@ -727,14 +801,42 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, { struct blob_attr *tb[__CSA_MAX]; struct hostapd_data *hapd = get_hapd_from_object(obj); - struct csa_settings css; + struct hostapd_config *iconf = hapd->iface->conf; + struct hostapd_freq_params *freq_params; ++ struct hostapd_hw_modes *mode = hapd->iface->current_mode; + struct csa_settings css = { + .freq_params = { + .ht_enabled = iconf->ieee80211n, @@ -5745,6 +5818,8 @@ index 0575fe2572..bcb80f4a33 100644 + .sec_channel_offset = iconf->secondary_channel, + } + }; ++ u8 chwidth = hostapd_get_oper_chwidth(iconf); ++ u8 seg0 = 0, seg1 = 0; + int ret = UBUS_STATUS_OK; + int i; @@ -5772,19 +5847,48 @@ index 0575fe2572..bcb80f4a33 100644 css.freq_params.freq = blobmsg_get_u32(tb[CSA_FREQ]); #define SET_CSA_SETTING(name, field, type) \ -@@ -750,12 +840,25 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, +@@ -750,12 +852,54 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, SET_CSA_SETTING(CSA_SEC_CHANNEL_OFFSET, freq_params.sec_channel_offset, u32); SET_CSA_SETTING(CSA_HT, freq_params.ht_enabled, bool); SET_CSA_SETTING(CSA_VHT, freq_params.vht_enabled, bool); + SET_CSA_SETTING(CSA_HE, freq_params.he_enabled, bool); SET_CSA_SETTING(CSA_BLOCK_TX, block_tx, bool); +- +- if (hostapd_switch_channel(hapd, &css) != 0) ++ css.freq_params.channel = hostapd_hw_get_channel(hapd, css.freq_params.freq); ++ if (!css.freq_params.channel) + return UBUS_STATUS_NOT_SUPPORTED; +- return UBUS_STATUS_OK; ++ ++ switch (css.freq_params.bandwidth) { ++ case 160: ++ chwidth = CHANWIDTH_160MHZ; ++ break; ++ case 80: ++ chwidth = css.freq_params.center_freq2 ? CHANWIDTH_80P80MHZ : CHANWIDTH_80MHZ; ++ break; ++ default: ++ chwidth = CHANWIDTH_USE_HT; ++ break; ++ } ++ ++ hostapd_set_freq_params(&css.freq_params, iconf->hw_mode, ++ css.freq_params.freq, ++ css.freq_params.channel, iconf->enable_edmg, ++ iconf->edmg_channel, ++ css.freq_params.ht_enabled, ++ css.freq_params.vht_enabled, ++ css.freq_params.he_enabled, ++ css.freq_params.sec_channel_offset, ++ chwidth, seg0, seg1, ++ iconf->vht_capab, ++ mode ? &mode->he_capab[IEEE80211_MODE_AP] : ++ NULL); ++ + for (i = 0; i < hapd->iface->num_bss; i++) { + struct hostapd_data *bss = hapd->iface->bss[i]; - -- if (hostapd_switch_channel(hapd, &css) != 0) -- return UBUS_STATUS_NOT_SUPPORTED; -- return UBUS_STATUS_OK; ++ + if (hostapd_switch_channel(bss, &css) != 0) + ret = UBUS_STATUS_NOT_SUPPORTED; + } @@ -5801,7 +5905,16 @@ index 0575fe2572..bcb80f4a33 100644 #undef SET_CSA_SETTING } #endif -@@ -1185,60 +1288,31 @@ hostapd_rrm_beacon_req(struct ubus_context *ctx, struct ubus_object *obj, +@@ -1085,7 +1229,7 @@ hostapd_rrm_nr_set(struct ubus_context *ctx, struct ubus_object *obj, + memcpy(&ssid, s, ssid.ssid_len); + } + +- hostapd_neighbor_set(hapd, bssid, &ssid, data, NULL, NULL, 0); ++ hostapd_neighbor_set(hapd, bssid, &ssid, data, NULL, NULL, 0, 0); + wpabuf_free(data); + continue; + +@@ -1185,60 +1329,31 @@ hostapd_rrm_beacon_req(struct ubus_context *ctx, struct ubus_object *obj, #ifdef CONFIG_WNM_AP @@ -5870,7 +5983,7 @@ index 0575fe2572..bcb80f4a33 100644 int len = strlen(blobmsg_get_string(cur)); if (len % 2) -@@ -1254,7 +1328,7 @@ hostapd_wnm_disassoc_imminent(struct ubus_context *ctx, struct ubus_object *obj, +@@ -1254,7 +1369,7 @@ hostapd_wnm_disassoc_imminent(struct ubus_context *ctx, struct ubus_object *obj, } nr_cur = nr; @@ -5879,7 +5992,7 @@ index 0575fe2572..bcb80f4a33 100644 int len = strlen(blobmsg_get_string(cur)) / 2; *nr_cur++ = WLAN_EID_NEIGHBOR_REPORT; -@@ -1271,22 +1345,186 @@ hostapd_wnm_disassoc_imminent(struct ubus_context *ctx, struct ubus_object *obj, +@@ -1271,22 +1386,186 @@ hostapd_wnm_disassoc_imminent(struct ubus_context *ctx, struct ubus_object *obj, if (nr) req_mode |= WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED; @@ -6069,7 +6182,7 @@ index 0575fe2572..bcb80f4a33 100644 UBUS_METHOD_NOARG("list_bans", hostapd_bss_list_bans), #ifdef CONFIG_WPS UBUS_METHOD_NOARG("wps_start", hostapd_bss_wps_start), -@@ -1307,6 +1545,7 @@ static const struct ubus_method bss_methods[] = { +@@ -1307,6 +1586,7 @@ static const struct ubus_method bss_methods[] = { UBUS_METHOD("rrm_beacon_req", hostapd_rrm_beacon_req, beacon_req_policy), #ifdef CONFIG_WNM_AP UBUS_METHOD("wnm_disassoc_imminent", hostapd_wnm_disassoc_imminent, wnm_disassoc_policy), @@ -6077,7 +6190,7 @@ index 0575fe2572..bcb80f4a33 100644 #endif }; -@@ -1369,6 +1608,43 @@ void hostapd_ubus_free_bss(struct hostapd_data *hapd) +@@ -1369,6 +1649,43 @@ void hostapd_ubus_free_bss(struct hostapd_data *hapd) free(name); } @@ -6121,7 +6234,7 @@ index 0575fe2572..bcb80f4a33 100644 static const struct ubus_method daemon_methods[] = { UBUS_METHOD("config_add", hostapd_config_add, config_add_policy), UBUS_METHOD("config_remove", hostapd_config_remove, config_remove_policy), -@@ -1555,3 +1831,103 @@ void hostapd_ubus_notify_beacon_report( +@@ -1555,3 +1872,103 @@ void hostapd_ubus_notify_beacon_report( ubus_notify(ctx, &hapd->ubus.obj, "beacon-report", b.head, -1); } @@ -6225,7 +6338,6 @@ index 0575fe2572..bcb80f4a33 100644 + return ureq.resp; +#endif +} -\ No newline at end of file diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h index e16017394f..f1bc093e57 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.h diff --git a/patches/wifi/0004-hostapd-pending-fixes.patch b/patches/wifi/0004-hostapd-pending-fixes.patch index 149e55533..01dc7c8b6 100644 --- a/patches/wifi/0004-hostapd-pending-fixes.patch +++ b/patches/wifi/0004-hostapd-pending-fixes.patch @@ -1,7 +1,7 @@ -From 83e8509388c5648dc8217b8f86d0461fade6a8d1 Mon Sep 17 00:00:00 2001 +From db1d10ff1663f3a08fd57bbc9d7b8e781055c1e1 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 4 Jan 2022 07:01:41 +0100 -Subject: [PATCH 4/4] hostapd: pending fixes +Subject: [PATCH 4/8] hostapd: pending fixes Signed-off-by: John Crispin --- diff --git a/patches/wifi/0005-hostapd-add-wispr-bandwidth-patch.patch b/patches/wifi/0005-hostapd-add-wispr-bandwidth-patch.patch index 588836e7d..468762b10 100644 --- a/patches/wifi/0005-hostapd-add-wispr-bandwidth-patch.patch +++ b/patches/wifi/0005-hostapd-add-wispr-bandwidth-patch.patch @@ -1,7 +1,7 @@ -From 844a6bacb1c416ad5f56ee60142e786548dd659c Mon Sep 17 00:00:00 2001 +From ede24c139935619b506d21b43516592c484bcce8 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 9 Nov 2021 12:49:43 +0100 -Subject: [PATCH] hostapd: add wispr bandwidth patch +Subject: [PATCH 5/8] hostapd: add wispr bandwidth patch Signed-off-by: John Crispin --- diff --git a/patches/wifi/0006-hostapd-add-multiple_bssid-rnr_beacon-he_co_locate-e.patch b/patches/wifi/0006-hostapd-add-multiple_bssid-rnr_beacon-he_co_locate-e.patch index dfe97a5b7..b0f480d5b 100644 --- a/patches/wifi/0006-hostapd-add-multiple_bssid-rnr_beacon-he_co_locate-e.patch +++ b/patches/wifi/0006-hostapd-add-multiple_bssid-rnr_beacon-he_co_locate-e.patch @@ -1,7 +1,7 @@ -From de25771a044c87fb9462066c4a162ea148612b89 Mon Sep 17 00:00:00 2001 +From bc32555de9efac9bd9b75c7b05166984cf1c45bc Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 7 Feb 2022 09:56:20 +0100 -Subject: [PATCH 6/7] hostapd: add multiple_bssid rnr_beacon he_co_locate ema +Subject: [PATCH 6/8] hostapd: add multiple_bssid rnr_beacon he_co_locate ema options Signed-off-by: John Crispin diff --git a/patches/wifi/0007-hostapd-move-radius-into-its-own-function.patch b/patches/wifi/0007-hostapd-move-radius-into-its-own-function.patch index 7450d43c8..a302603cc 100644 --- a/patches/wifi/0007-hostapd-move-radius-into-its-own-function.patch +++ b/patches/wifi/0007-hostapd-move-radius-into-its-own-function.patch @@ -1,7 +1,7 @@ -From d6510fa7b82b8e9fdd2266142aa7472ec407bcfb Mon Sep 17 00:00:00 2001 +From e3bfe63522e56abec6ed6baab135eae6b29ddaf4 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 7 Feb 2022 11:16:12 +0100 -Subject: [PATCH 7/7] hostapd: move radius into its own function +Subject: [PATCH 7/8] hostapd: move radius into its own function Signed-off-by: John Crispin --- diff --git a/patches/wifi/0008-hostapd-automatically-calculate-channel-center-freq-.patch b/patches/wifi/0008-hostapd-automatically-calculate-channel-center-freq-.patch deleted file mode 100644 index 721729832..000000000 --- a/patches/wifi/0008-hostapd-automatically-calculate-channel-center-freq-.patch +++ /dev/null @@ -1,89 +0,0 @@ -From ec58340d35489da5851ccd75e921ecd700ace471 Mon Sep 17 00:00:00 2001 -From: Felix Fietkau -Date: Mon, 7 Feb 2022 13:11:01 +0100 -Subject: [PATCH] hostapd: automatically calculate channel center freq on - chan_switch - -Simplifies switching to different channels when on >= VHT80 - -Signed-off-by: Felix Fietkau ---- - .../services/hostapd/src/src/ap/ubus.c | 34 +++++++++++++++++++ - 1 file changed, 34 insertions(+) - -diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c -index bcb80f4a33..5c9e966f70 100644 ---- a/package/network/services/hostapd/src/src/ap/ubus.c -+++ b/package/network/services/hostapd/src/src/ap/ubus.c -@@ -11,6 +11,7 @@ - #include "utils/eloop.h" - #include "utils/wpabuf.h" - #include "common/ieee802_11_defs.h" -+#include "common/hw_features_common.h" - #include "hostapd.h" - #include "neighbor_db.h" - #include "wps_hostapd.h" -@@ -22,6 +23,7 @@ - #include "wnm_ap.h" - #include "taxonomy.h" - #include "airtime_policy.h" -+#include "hw_features.h" - - static struct ubus_context *ctx; - static struct blob_buf b; -@@ -794,6 +796,7 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, - struct hostapd_data *hapd = get_hapd_from_object(obj); - struct hostapd_config *iconf = hapd->iface->conf; - struct hostapd_freq_params *freq_params; -+ struct hostapd_hw_modes *mode = hapd->iface->current_mode; - struct csa_settings css = { - .freq_params = { - .ht_enabled = iconf->ieee80211n, -@@ -802,6 +805,8 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, - .sec_channel_offset = iconf->secondary_channel, - } - }; -+ u8 chwidth = hostapd_get_oper_chwidth(iconf); -+ u8 seg0 = 0, seg1 = 0; - int ret = UBUS_STATUS_OK; - int i; - -@@ -843,6 +848,35 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, - SET_CSA_SETTING(CSA_HE, freq_params.he_enabled, bool); - SET_CSA_SETTING(CSA_BLOCK_TX, block_tx, bool); - -+ css.freq_params.channel = hostapd_hw_get_channel(hapd, css.freq_params.freq); -+ if (!css.freq_params.channel) -+ return UBUS_STATUS_NOT_SUPPORTED; -+ -+ switch (css.freq_params.bandwidth) { -+ case 160: -+ chwidth = CHANWIDTH_160MHZ; -+ break; -+ case 80: -+ chwidth = css.freq_params.center_freq2 ? CHANWIDTH_80P80MHZ : CHANWIDTH_80MHZ; -+ break; -+ default: -+ chwidth = CHANWIDTH_USE_HT; -+ break; -+ } -+ -+ hostapd_set_freq_params(&css.freq_params, iconf->hw_mode, -+ css.freq_params.freq, -+ css.freq_params.channel, iconf->enable_edmg, -+ iconf->edmg_channel, -+ css.freq_params.ht_enabled, -+ css.freq_params.vht_enabled, -+ css.freq_params.he_enabled, -+ css.freq_params.sec_channel_offset, -+ chwidth, seg0, seg1, -+ iconf->vht_capab, -+ mode ? &mode->he_capab[IEEE80211_MODE_AP] : -+ NULL); -+ - for (i = 0; i < hapd->iface->num_bss; i++) { - struct hostapd_data *bss = hapd->iface->bss[i]; - --- -2.25.1 - diff --git a/patches/wifi/0009-hostapd-add-acs_exclude_dfs-support.patch b/patches/wifi/0009-hostapd-add-acs_exclude_dfs-support.patch deleted file mode 100644 index e14bb2343..000000000 --- a/patches/wifi/0009-hostapd-add-acs_exclude_dfs-support.patch +++ /dev/null @@ -1,50 +0,0 @@ -From feffdf73c7a789ac65d91494b371a93babfba69a Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Sat, 12 Feb 2022 16:43:15 +0100 -Subject: [PATCH] hostapd: add acs_exclude_dfs support - -Signed-off-by: John Crispin ---- - package/network/services/hostapd/files/hostapd.sh | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh -index c8e1eca88b..244e405b59 100644 ---- a/package/network/services/hostapd/files/hostapd.sh -+++ b/package/network/services/hostapd/files/hostapd.sh -@@ -119,6 +119,7 @@ hostapd_common_add_device_config() { - config_add_int maxassoc - - config_add_string acs_chan_bias -+ config_add_boolean acs_exclude_dfs - config_add_array hostapd_options - - config_add_int airtime_mode -@@ -137,7 +138,7 @@ hostapd_prepare_device_config() { - json_get_vars country country3 country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ - acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \ - rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc \ -- multiple_bssid he_co_locate rnr_beacon ema -+ multiple_bssid he_co_locate rnr_beacon ema acs_exclude_dfs - - hostapd_set_log_options base_cfg - -@@ -151,6 +152,7 @@ hostapd_prepare_device_config() { - set_default rnr_beacon 0 - set_default multiple_bssid 0 - set_default ema 0 -+ set_default acs_exclude_dfs 0 - - [ -n "$country" ] && { - append base_cfg "country_code=$country" "$N" -@@ -247,6 +249,7 @@ hostapd_prepare_device_config() { - [ "$he_co_locate" -gt 0 ] && append base_cfg "he_co_locate=$he_co_locate" "$N" - [ "$multiple_bssid" -gt 0 ] && append base_cfg "multiple_bssid=$multiple_bssid" "$N" - [ "$ema" -gt 0 ] && append base_cfg "ema=$ema" "$N" -+ [ "$acs_exclude_dfs" -gt 0 ] && append base_cfg "acs_exclude_dfs=$acs_exclude_dfs" "$N" - - json_get_values opts hostapd_options - for val in $opts; do --- -2.25.1 -