From e4769cfe7ede3101b650291646bb103ff34c8010 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 16 Sep 2022 15:49:45 +0200 Subject: [PATCH] FIX: [hostapd/wpa-supplicant] update hostapd and wpa-supplicant BugzId: 78943 --- ...tifact-build_features.h-to-gitignore.patch | 8 +- ...sioned-shared-library-libwlan_client.patch | 10 +- ...se-environment-variable-EXTRA_CFLAGS.patch | 16 +- ...-fix-frequency-setup-with-HE-enabled.patch | 203 ------ .../001-wolfssl-init-RNG-with-ECC-key.patch | 46 ++ ...-init-order-disable-pri-sec-channel-.patch | 130 ---- ...andle-HT40-and-mode-downgrade-in-AP-.patch | 104 --- ...ix-frequency-config-for-non-p2p-vht-.patch | 65 -- ...nable-vht-and-he-in-default-config-p.patch | 28 - ...er-debug-messages-for-some-error-cas.patch | 86 --- ...lper-functions-for-vht-he-parameters.patch | 30 - ...ompletion-callback-to-complete-mesh-.patch | 112 --- ...-frequency-as-pri-sec-channel-switch.patch | 29 - ...hannels-to-be-selected-if-dfs-is-ena.patch | 68 +- ...offchanok-on-DFS-channels-in-non-ETS.patch | 56 -- ...rministic-channel-on-channel-switch.patch} | 16 +- ...-fix-channel-switch-error-during-CAC.patch | 69 -- ...rnel-driver-DFS-handler-in-userspace.patch | 55 -- .../014-mesh-fixes-for-mesh-init-deinit.patch | 165 ----- .../files/015-mesh-fix-DFS-deinit-init.patch | 271 -------- ...sts-DFS-test-for-wpa_supplicant-mesh.patch | 97 --- .../files/017-mesh-fix-mesh_oom-test.patch | 27 - ...ve-mesh-freq-setting-to-own-function.patch | 96 --- ...020-ignore-4addr-mode-enabling-error.patch | 76 -- ...ix-sta-add-after-previous-connection.patch | 26 + ...use-of-uninitialized-stack-variables.patch | 31 + ...-dl_list_del-before-freeing-ipv6-add.patch | 25 + ...ewrite-neigh-code-to-not-depend-on-l.patch | 281 ++++++++ ...ssing-authentication-frames-in-block.patch | 40 ++ .../hostapd/files/050-build_fix.patch | 33 + ...50-mesh-make-forwarding-configurable.patch | 240 ------- ...-case-in-peer-addition-based-on-PD-R.patch | 48 -- .../hostapd/files/100-daemonize_fix.patch | 6 +- .../files/110-notify-mgmt-frames.patch | 127 ---- .../files/110-wolfssl-compile-fix.patch | 20 - .../120-reconfigure-wps-credentials.patch | 185 ----- .../hostapd/files/200-multicall.patch | 106 +-- .../hostapd/files/300-noscan.patch | 14 +- .../hostapd/files/301-mesh-noscan.patch | 29 +- .../files/310-rescan_immediately.patch | 6 +- .../hostapd/files/320-optional_rfkill.patch | 12 +- .../files/330-nl80211_fix_set_freq.patch | 10 +- .../files/340-reload_freq_change.patch | 15 +- .../341-mesh-ctrl-iface-channel-switch.patch | 6 +- .../files/350-nl80211_del_beacon_bss.patch | 42 +- .../hostapd/files/360-ctrl_iface_reload.patch | 20 +- .../hostapd/files/370-ap_sta_support.patch | 126 ++-- .../files/380-disable_ctrl_iface_mib.patch | 60 +- .../381-hostapd_cli_UNKNOWN-COMMAND.patch | 4 +- .../files/390-wpa_ie_cap_workaround.patch | 8 +- .../files/400-wps_single_auth_enc_type.patch | 6 +- .../files/410-limit_debug_messages.patch | 6 +- .../hostapd/files/420-indicate-features.patch | 43 +- .../hostapd/files/430-hostapd_cli_ifdef.patch | 8 +- .../hostapd/files/431-wpa_cli_ifdef.patch | 4 +- .../hostapd/files/432-missing-typedef.patch | 2 +- .../hostapd/files/450-scan_wait.patch | 4 +- ...dd-new-config-params-to-be-used-with.patch | 24 +- ...-use-new-parameters-during-ibss-join.patch | 8 +- .../files/463-add-mcast_rate-to-11s.patch | 18 +- .../files/464-fix-mesh-obss-check.patch | 6 +- ...tapd-config-support-random-BSS-color.patch | 27 + .../files/470-survey_data_fallback.patch | 30 +- .../files/500-lto-jobserver-support.patch | 25 +- .../files/590-rrm-wnm-statistics.patch | 108 +++ .../599-wpa_supplicant-fix-warnings.patch | 2 +- .../610-hostapd_cli_ujail_permission.patch | 43 ++ .../hostapd/files/700-wifi-reload.patch | 96 ++- .../hostapd/files/710-vlan_no_bridge.patch | 57 ++ .../hostapd/files/711-wds_bridge_force.patch | 35 + .../hostapd/files/720-iface_max_num_sta.patch | 104 +++ .../hostapd/files/730-ft_iface.patch | 54 ++ .../hostapd/files/740-snoop_iface.patch | 82 +++ ...750-qos_map_set_without_interworking.patch | 116 ++++ .../751-qos_map_ignore_when_unsupported.patch | 22 + ...ate-if-no-available-channel-is-found.patch | 40 -- ...of-secondary-device-types-for-P2P-gr.patch | 36 - .../files/910-wpa_supplicant_remove_acl.patch | 42 ++ .../hostapd/files/912-iapp-integration.patch | 98 +-- .../hostapd/files/913-iapp-improvements.patch | 44 +- .../files/914-wlan-acs-srd-channels.patch | 46 +- ..._AP-functions-dependant-on-CONFIG_AP.patch | 38 + .../hostapd/files/991-fix-compile.patch | 19 + .../files/992-openssl-include-rsa.patch | 32 + .../hostapd/files/hostapd-full.config | 2 +- .../hostapd/files/src/ap/ubus.c | 652 ++++++++++++++++-- .../hostapd/files/src/ap/ubus.h | 42 ++ .../hostapd/files/src/utils/build_features.h | 10 +- recipes-connectivity/hostapd/hostapd.inc | 61 +- 89 files changed, 2435 insertions(+), 3040 deletions(-) delete mode 100644 recipes-connectivity/hostapd/files/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch create mode 100644 recipes-connectivity/hostapd/files/001-wolfssl-init-RNG-with-ECC-key.patch delete mode 100644 recipes-connectivity/hostapd/files/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch delete mode 100644 recipes-connectivity/hostapd/files/003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch delete mode 100644 recipes-connectivity/hostapd/files/004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch delete mode 100644 recipes-connectivity/hostapd/files/005-wpa_supplicant-enable-vht-and-he-in-default-config-p.patch delete mode 100644 recipes-connectivity/hostapd/files/006-hw_features-better-debug-messages-for-some-error-cas.patch delete mode 100644 recipes-connectivity/hostapd/files/007-dfs-use-helper-functions-for-vht-he-parameters.patch delete mode 100644 recipes-connectivity/hostapd/files/008-mesh-use-setup-completion-callback-to-complete-mesh-.patch delete mode 100644 recipes-connectivity/hostapd/files/009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch delete mode 100644 recipes-connectivity/hostapd/files/011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch rename recipes-connectivity/hostapd/files/{019-mesh-use-deterministic-channel-on-channel-switch.patch => 011-mesh-use-deterministic-channel-on-channel-switch.patch} (84%) delete mode 100644 recipes-connectivity/hostapd/files/012-mesh-fix-channel-switch-error-during-CAC.patch delete mode 100644 recipes-connectivity/hostapd/files/013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch delete mode 100644 recipes-connectivity/hostapd/files/014-mesh-fixes-for-mesh-init-deinit.patch delete mode 100644 recipes-connectivity/hostapd/files/015-mesh-fix-DFS-deinit-init.patch delete mode 100644 recipes-connectivity/hostapd/files/016-tests-DFS-test-for-wpa_supplicant-mesh.patch delete mode 100644 recipes-connectivity/hostapd/files/017-mesh-fix-mesh_oom-test.patch delete mode 100644 recipes-connectivity/hostapd/files/018-mesh-move-mesh-freq-setting-to-own-function.patch delete mode 100644 recipes-connectivity/hostapd/files/020-ignore-4addr-mode-enabling-error.patch create mode 100644 recipes-connectivity/hostapd/files/021-fix-sta-add-after-previous-connection.patch create mode 100644 recipes-connectivity/hostapd/files/022-hostapd-fix-use-of-uninitialized-stack-variables.patch create mode 100644 recipes-connectivity/hostapd/files/023-ndisc_snoop-call-dl_list_del-before-freeing-ipv6-add.patch create mode 100644 recipes-connectivity/hostapd/files/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch create mode 100644 recipes-connectivity/hostapd/files/040-mesh-allow-processing-authentication-frames-in-block.patch create mode 100644 recipes-connectivity/hostapd/files/050-build_fix.patch delete mode 100644 recipes-connectivity/hostapd/files/050-mesh-make-forwarding-configurable.patch delete mode 100644 recipes-connectivity/hostapd/files/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch delete mode 100644 recipes-connectivity/hostapd/files/110-notify-mgmt-frames.patch delete mode 100644 recipes-connectivity/hostapd/files/110-wolfssl-compile-fix.patch delete mode 100644 recipes-connectivity/hostapd/files/120-reconfigure-wps-credentials.patch create mode 100644 recipes-connectivity/hostapd/files/465-hostapd-config-support-random-BSS-color.patch create mode 100644 recipes-connectivity/hostapd/files/590-rrm-wnm-statistics.patch create mode 100644 recipes-connectivity/hostapd/files/610-hostapd_cli_ujail_permission.patch create mode 100644 recipes-connectivity/hostapd/files/710-vlan_no_bridge.patch create mode 100644 recipes-connectivity/hostapd/files/711-wds_bridge_force.patch create mode 100644 recipes-connectivity/hostapd/files/720-iface_max_num_sta.patch create mode 100644 recipes-connectivity/hostapd/files/730-ft_iface.patch create mode 100644 recipes-connectivity/hostapd/files/740-snoop_iface.patch create mode 100644 recipes-connectivity/hostapd/files/750-qos_map_set_without_interworking.patch create mode 100644 recipes-connectivity/hostapd/files/751-qos_map_ignore_when_unsupported.patch delete mode 100644 recipes-connectivity/hostapd/files/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch delete mode 100644 recipes-connectivity/hostapd/files/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch create mode 100644 recipes-connectivity/hostapd/files/910-wpa_supplicant_remove_acl.patch create mode 100644 recipes-connectivity/hostapd/files/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch create mode 100644 recipes-connectivity/hostapd/files/991-fix-compile.patch create mode 100644 recipes-connectivity/hostapd/files/992-openssl-include-rsa.patch diff --git a/recipes-connectivity/hostapd/files/0001-Add-build-artifact-build_features.h-to-gitignore.patch b/recipes-connectivity/hostapd/files/0001-Add-build-artifact-build_features.h-to-gitignore.patch index 1b830b2..6a8a01a 100644 --- a/recipes-connectivity/hostapd/files/0001-Add-build-artifact-build_features.h-to-gitignore.patch +++ b/recipes-connectivity/hostapd/files/0001-Add-build-artifact-build_features.h-to-gitignore.patch @@ -8,11 +8,11 @@ Subject: [PATCH] Add build artifact build_features.h to gitignore 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore -index 6a985a75d..dd6bf9291 100644 +index b064303ce..435e9e19d 100644 --- a/.gitignore +++ b/.gitignore -@@ -33,3 +33,4 @@ wlantest/test_vectors - wlantest/wlantest - wlantest/wlantest_cli +@@ -6,3 +6,4 @@ wpaspy/build **/parallel-vm.log + tags + build/ +src/utils/build_features.h diff --git a/recipes-connectivity/hostapd/files/0001-fix-create-a-versioned-shared-library-libwlan_client.patch b/recipes-connectivity/hostapd/files/0001-fix-create-a-versioned-shared-library-libwlan_client.patch index 7200bc9..d48e25c 100644 --- a/recipes-connectivity/hostapd/files/0001-fix-create-a-versioned-shared-library-libwlan_client.patch +++ b/recipes-connectivity/hostapd/files/0001-fix-create-a-versioned-shared-library-libwlan_client.patch @@ -12,15 +12,15 @@ BugzId: 75694 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile -index 238e31b0c..58c047543 100644 +index 5f5f049ae..1a41c1209 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -1965,7 +1965,7 @@ libwpa_client.a: $(LIBCTRL) +@@ -2003,7 +2003,7 @@ libwpa_client.a: $(LIBCTRL) libwpa_client.so: $(LIBCTRLSO) @$(E) " CC $@ ($^)" - $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^ -+ $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -Wl,-soname,libwpa_client.so.2.10.0 -fPIC $^ ++ $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -Wl,-soname,libwpa_client.so.$(WPAPV) -fPIC $^ - libwpa_test1: libwpa_test.o libwpa_client.a - $(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 libwpa_test.o libwpa_client.a $(LIBS_c) + OBJS_wpatest := libwpa_test.o + _OBJS_VAR := OBJS_wpatest diff --git a/recipes-connectivity/hostapd/files/0002-Use-environment-variable-EXTRA_CFLAGS.patch b/recipes-connectivity/hostapd/files/0002-Use-environment-variable-EXTRA_CFLAGS.patch index a339f3e..93d99d4 100644 --- a/recipes-connectivity/hostapd/files/0002-Use-environment-variable-EXTRA_CFLAGS.patch +++ b/recipes-connectivity/hostapd/files/0002-Use-environment-variable-EXTRA_CFLAGS.patch @@ -1,4 +1,4 @@ -From dd38a7c5dd2222573e267767831f0cdfcbc272df Mon Sep 17 00:00:00 2001 +From c1bd2dd68e6c55767cf39e65f841c80c696ff7ae Mon Sep 17 00:00:00 2001 From: Moritz Rosenthal Date: Sat, 29 Feb 2020 21:17:05 +0100 Subject: [PATCH] Use environment variable EXTRA_CFLAGS @@ -8,15 +8,15 @@ Subject: [PATCH] Use environment variable EXTRA_CFLAGS 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rules b/src/lib.rules -index a46315442..3eb721a6d 100644 +index 947617b07..ffdfc5c8d 100644 --- a/src/lib.rules +++ b/src/lib.rules -@@ -3,7 +3,7 @@ CC=gcc +@@ -10,7 +10,7 @@ CFLAGS += -DTEST_FUZZ endif - ifndef CFLAGS --CFLAGS = -MMD -O2 -Wall -g -+CFLAGS = -MMD -O2 -Wall -g $(EXTRA_CFLAGS) - endif + CFLAGS += $(FUZZ_CFLAGS) +-CFLAGS += -I.. -I../utils ++CFLAGS += -I.. -I../utils $(EXTRA_CFLAGS) - ifdef TEST_FUZZ + _OBJS_VAR := LIB_OBJS + include ../objs.mk diff --git a/recipes-connectivity/hostapd/files/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch b/recipes-connectivity/hostapd/files/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch deleted file mode 100644 index 944556d..0000000 --- a/recipes-connectivity/hostapd/files/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch +++ /dev/null @@ -1,203 +0,0 @@ -From c8d6b2cde0d37ef0fe5a888f5eaf8bf6d02973ad Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:17 +0200 -Subject: [PATCH] HE/VHT: fix frequency setup with HE enabled - -Some places in the code base were not using the -wrappers like hostapd_set_oper_centr_freq_seg0_idx -and friends. This could lead to errors, for example when -joining 80 MHz mesh networks. Fix this, by enforcing -usage of these wrappers. - -wpa_supplicant_conf_ap_ht now checks for HE capability -before dealing with VHT in order for these wrappers to work, -as they first check HE support in the config. - -While doing these changes, I've noticed that the extra -channel setup code for mesh networks in wpa_supplicant/mesh.c -should not be necessary anymore and dropped it. -wpa_supplicant_conf_ap_ht should handle this setup already. - -Acked-by: John Crispin -Signed-off-by: Markus Theil - ---- - src/ap/dfs.c | 8 ++++---- - wpa_supplicant/ap.c | 40 +++++++++++++++++++++++----------------- - wpa_supplicant/mesh.c | 24 ------------------------ - 3 files changed, 27 insertions(+), 45 deletions(-) - -diff --git a/src/ap/dfs.c b/src/ap/dfs.c -index 3c078b9cb..f62da49a7 100644 ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -1028,7 +1028,7 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) - unsigned int i; - int err = 1; - struct hostapd_hw_modes *cmode = iface->current_mode; -- u8 current_vht_oper_chwidth = iface->conf->vht_oper_chwidth; -+ u8 current_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf); - - wpa_printf(MSG_DEBUG, "%s called (CAC active: %s, CSA active: %s)", - __func__, iface->cac_started ? "yes" : "no", -@@ -1089,8 +1089,8 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) - "freq=%d chan=%d sec_chan=%d", channel->freq, - channel->chan, secondary_channel); - -- new_vht_oper_chwidth = iface->conf->vht_oper_chwidth; -- iface->conf->vht_oper_chwidth = current_vht_oper_chwidth; -+ new_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf); -+ hostapd_set_oper_chwidth(iface->conf, current_vht_oper_chwidth); - - /* Setup CSA request */ - os_memset(&csa_settings, 0, sizeof(csa_settings)); -@@ -1130,7 +1130,7 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) - iface->freq = channel->freq; - iface->conf->channel = channel->chan; - iface->conf->secondary_channel = secondary_channel; -- iface->conf->vht_oper_chwidth = new_vht_oper_chwidth; -+ hostapd_set_oper_chwidth(iface->conf, new_vht_oper_chwidth); - hostapd_set_oper_centr_freq_seg0_idx(iface->conf, - oper_centr_freq_seg0_idx); - hostapd_set_oper_centr_freq_seg1_idx(iface->conf, -diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c -index 624168205..5b75821a2 100644 ---- a/wpa_supplicant/ap.c -+++ b/wpa_supplicant/ap.c -@@ -52,6 +52,7 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s, - #ifdef CONFIG_P2P - u8 center_chan = 0; - u8 channel = conf->channel; -+ u8 freq_seg_idx; - #endif /* CONFIG_P2P */ - - if (!conf->secondary_channel) -@@ -59,19 +60,21 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s, - - /* Use the maximum oper channel width if it's given. */ - if (ssid->max_oper_chwidth) -- conf->vht_oper_chwidth = ssid->max_oper_chwidth; -+ hostapd_set_oper_chwidth(conf, ssid->max_oper_chwidth); - - ieee80211_freq_to_chan(ssid->vht_center_freq2, -- &conf->vht_oper_centr_freq_seg1_idx); -+ &freq_seg_idx); -+ hostapd_set_oper_centr_freq_seg1_idx(conf, freq_seg_idx); - - if (!ssid->p2p_group) { - if (!ssid->vht_center_freq1 || -- conf->vht_oper_chwidth == CHANWIDTH_USE_HT) -+ hostapd_get_oper_chwidth(conf) == CHANWIDTH_USE_HT) - goto no_vht; - ieee80211_freq_to_chan(ssid->vht_center_freq1, -- &conf->vht_oper_centr_freq_seg0_idx); -+ &freq_seg_idx); -+ hostapd_set_oper_centr_freq_seg0_idx(conf, freq_seg_idx); - wpa_printf(MSG_DEBUG, "VHT seg0 index %d for AP", -- conf->vht_oper_centr_freq_seg0_idx); -+ hostapd_get_oper_centr_freq_seg0_idx(conf)); - return; - } - -@@ -96,14 +99,14 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s, - * try oper_cwidth 160 MHz first then VHT 80 MHz, if 160 MHz is - * not supported. - */ -- conf->vht_oper_chwidth = CHANWIDTH_160MHZ; -+ hostapd_set_oper_chwidth(conf, CHANWIDTH_160MHZ); - center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel); - if (center_chan) { - wpa_printf(MSG_DEBUG, - "VHT center channel %u for auto-selected 160 MHz bandwidth", - center_chan); - } else { -- conf->vht_oper_chwidth = CHANWIDTH_80MHZ; -+ hostapd_set_oper_chwidth(conf, CHANWIDTH_80MHZ); - center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, - channel); - wpa_printf(MSG_DEBUG, -@@ -115,9 +118,9 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s, - if (!center_chan) - goto no_vht; - -- conf->vht_oper_centr_freq_seg0_idx = center_chan; -+ hostapd_set_oper_centr_freq_seg0_idx(conf, center_chan); - wpa_printf(MSG_DEBUG, "VHT seg0 index %d for P2P GO", -- conf->vht_oper_centr_freq_seg0_idx); -+ hostapd_get_oper_centr_freq_seg0_idx(conf)); - return; - #endif /* CONFIG_P2P */ - -@@ -125,9 +128,9 @@ no_vht: - wpa_printf(MSG_DEBUG, - "No VHT higher bandwidth support for the selected channel %d", - conf->channel); -- conf->vht_oper_centr_freq_seg0_idx = -- conf->channel + conf->secondary_channel * 2; -- conf->vht_oper_chwidth = CHANWIDTH_USE_HT; -+ hostapd_set_oper_centr_freq_seg0_idx(conf, -+ conf->channel + conf->secondary_channel * 2); -+ hostapd_set_oper_chwidth(conf, CHANWIDTH_USE_HT); - } - - -@@ -231,16 +234,19 @@ int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, - HT_CAP_INFO_TX_STBC | - HT_CAP_INFO_MAX_AMSDU_SIZE); - -+ /* check this before VHT, because setting oper chan -+ * width and friends is the same call for HE and VHT -+ * and checks if conf->ieee8021ax == 1 */ -+ if (mode->he_capab[wpas_mode_to_ieee80211_mode( -+ ssid->mode)].he_supported && -+ ssid->he) -+ conf->ieee80211ax = 1; -+ - if (mode->vht_capab && ssid->vht) { - conf->ieee80211ac = 1; - conf->vht_capab |= mode->vht_capab; - wpas_conf_ap_vht(wpa_s, ssid, conf, mode); - } -- -- if (mode->he_capab[wpas_mode_to_ieee80211_mode( -- ssid->mode)].he_supported && -- ssid->he) -- conf->ieee80211ax = 1; - } - } - -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index c085466b1..8cacf28e1 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -333,30 +333,6 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - frequency); - goto out_free; - } -- if (ssid->ht40) -- conf->secondary_channel = ssid->ht40; -- if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) { -- if (ssid->max_oper_chwidth != DEFAULT_MAX_OPER_CHWIDTH) -- conf->vht_oper_chwidth = ssid->max_oper_chwidth; -- switch (conf->vht_oper_chwidth) { -- case CHANWIDTH_80MHZ: -- case CHANWIDTH_80P80MHZ: -- ieee80211_freq_to_chan( -- frequency, -- &conf->vht_oper_centr_freq_seg0_idx); -- conf->vht_oper_centr_freq_seg0_idx += ssid->ht40 * 2; -- break; -- case CHANWIDTH_160MHZ: -- ieee80211_freq_to_chan( -- frequency, -- &conf->vht_oper_centr_freq_seg0_idx); -- conf->vht_oper_centr_freq_seg0_idx += ssid->ht40 * 2; -- conf->vht_oper_centr_freq_seg0_idx += 40 / 5; -- break; -- } -- ieee80211_freq_to_chan(ssid->vht_center_freq2, -- &conf->vht_oper_centr_freq_seg1_idx); -- } - - if (ssid->mesh_basic_rates == NULL) { - /* diff --git a/recipes-connectivity/hostapd/files/001-wolfssl-init-RNG-with-ECC-key.patch b/recipes-connectivity/hostapd/files/001-wolfssl-init-RNG-with-ECC-key.patch new file mode 100644 index 0000000..7223154 --- /dev/null +++ b/recipes-connectivity/hostapd/files/001-wolfssl-init-RNG-with-ECC-key.patch @@ -0,0 +1,46 @@ +From ae4dbb9e7a3f94a143b9a18e124773a7cb52589b Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Wed, 5 May 2021 00:44:34 +0200 +Subject: [PATCH] wolfssl: add RNG to EC key + +Since upstream commit 6467de5a8840 ("Randomize z ordinates in +scalar mult when timing resistant") WolfSSL requires a RNG for +the EC key when built hardened which is the default. + +Set the RNG for the EC key to fix connections for OWE clients. + +Signed-off-by: David Bauer + +--- + src/crypto/crypto_wolfssl.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c +index f47beebeb..a28349b66 100644 +--- a/src/crypto/crypto_wolfssl.c ++++ b/src/crypto/crypto_wolfssl.c +@@ -1340,6 +1340,7 @@ int ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, + + struct crypto_ec { + ecc_key key; ++ WC_RNG rng; + mp_int a; + mp_int prime; + mp_int order; +@@ -1394,6 +1395,8 @@ struct crypto_ec * crypto_ec_init(int group) + return NULL; + + if (wc_ecc_init(&e->key) != 0 || ++ wc_InitRng(&e->rng) != 0 || ++ wc_ecc_set_rng(&e->key, &e->rng) != 0 || + wc_ecc_set_curve(&e->key, 0, curve_id) != 0 || + mp_init(&e->a) != MP_OKAY || + mp_init(&e->prime) != MP_OKAY || +@@ -1425,6 +1428,7 @@ void crypto_ec_deinit(struct crypto_ec* e) + mp_clear(&e->order); + mp_clear(&e->prime); + mp_clear(&e->a); ++ wc_FreeRng(&e->rng); + wc_ecc_free(&e->key); + os_free(e); + } diff --git a/recipes-connectivity/hostapd/files/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch b/recipes-connectivity/hostapd/files/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch deleted file mode 100644 index 3294fca..0000000 --- a/recipes-connectivity/hostapd/files/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch +++ /dev/null @@ -1,130 +0,0 @@ -From f212c6af4de6d0a779b6b131905f5f0c0f4ebd8f Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:18 +0200 -Subject: [PATCH] mesh: fix channel init order, disable pri/sec channel switch - -wpa_supplicant_conf_ap_ht has to happen before hostapd_setup_interface -in order for its configuration settings to have effect on interface -configuration. - -Disable primary and secondary channel switch because of missing tie -breaking rule/frames in mesh networks. A rather long comment about -this issue is placed in mesh.c in the corresponding place. - -In consequence, remove mesh coex test, which contradicts this change. - -I was not able to reproduce the memory corruption during -mesh_secure_ocv_mix_legacy, which lead to a revert of a similar patch -in the past. - -Signed-off-by: Markus Theil - ---- - tests/hwsim/test_wpas_mesh.py | 50 ------------------------------------------- - wpa_supplicant/mesh.c | 25 ++++++++++++++++++++-- - 2 files changed, 23 insertions(+), 52 deletions(-) - -diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py -index 3c918184f..bc07f5e25 100644 ---- a/tests/hwsim/test_wpas_mesh.py -+++ b/tests/hwsim/test_wpas_mesh.py -@@ -933,56 +933,6 @@ def _test_wpas_mesh_open_5ghz(dev, apdev): - dev[0].dump_monitor() - dev[1].dump_monitor() - --def test_wpas_mesh_open_5ghz_coex(dev, apdev): -- """Mesh network on 5 GHz band and 20/40 coex change""" -- try: -- _test_wpas_mesh_open_5ghz_coex(dev, apdev) -- finally: -- dev[0].request("MESH_GROUP_REMOVE " + dev[0].ifname) -- dev[1].request("MESH_GROUP_REMOVE " + dev[1].ifname) -- set_world_reg(apdev0=apdev[0], dev0=dev[0]) -- dev[0].flush_scan_cache() -- dev[1].flush_scan_cache() -- --def _test_wpas_mesh_open_5ghz_coex(dev, apdev): -- check_mesh_support(dev[0]) -- subprocess.call(['iw', 'reg', 'set', 'US']) -- -- # Start a 20 MHz BSS on channel 40 that would be the secondary channel of -- # HT40+ mesh on channel 36. -- params = {"ssid": "test-ht40", -- "hw_mode": "a", -- "channel": "40", -- "country_code": "US"} -- hapd = hostapd.add_ap(apdev[0], params) -- bssid = hapd.own_addr() -- -- for i in range(2): -- for j in range(5): -- ev = dev[i].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=5) -- if ev is None: -- raise Exception("No regdom change event") -- if "alpha2=US" in ev: -- break -- dev[i].scan_for_bss(bssid, freq=5200) -- add_open_mesh_network(dev[i], freq="5180") -- -- check_mesh_joined_connected(dev) -- -- freq = dev[0].get_status_field("freq") -- if freq != "5200": -- raise Exception("Unexpected STATUS freq=" + freq) -- sig = dev[0].request("SIGNAL_POLL").splitlines() -- if "FREQUENCY=5200" not in sig: -- raise Exception("Unexpected SIGNAL_POLL output: " + str(sig)) -- -- hapd.disable() -- dev[0].mesh_group_remove() -- dev[1].mesh_group_remove() -- check_mesh_group_removed(dev[0]) -- check_mesh_group_removed(dev[1]) -- dev[0].dump_monitor() -- dev[1].dump_monitor() - - def test_wpas_mesh_open_ht40(dev, apdev): - """Mesh and HT40 support difference""" -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 8cacf28e1..941c95cfd 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -363,6 +363,29 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - conf->basic_rates[rate_len] = -1; - } - -+ /* While it can enhance performance to switch the primary channel, which -+ * is also the secondary channel of another network at the same time), -+ * to the other primary channel, problems exist with this in mesh networks. -+ * -+ * Example with problems: -+ * - 3 mesh nodes M1-M3, freq (5200, 5180) -+ * - other node O1, e.g. AP mode, freq (5180, 5200), -+ * Locations: O1 M1 M2 M3 -+ * -+ * M3 can only send frames to M1 over M2, no direct connection is possible -+ * Start O1, M1 and M3 first, M1 or O1 will switch channels to align with -+ * each other. M3 does not swap, because M1 or O1 cannot be reached. -+ * M2 is started afterwards and can either connect to M3 or M1 because of -+ * this primary secondary channel switch. -+ * -+ * Solutions: (1) central coordination -> not always possible -+ * (2) disable pri/sec channel switch in mesh networks -+ * -+ * In AP mode, when all nodes can work independently, this poses of course -+ * no problem, therefore disable it only in mesh mode.`*/ -+ conf->no_pri_sec_switch = 1; -+ wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf); -+ - if (wpa_drv_init_mesh(wpa_s)) { - wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver"); - return -1; -@@ -374,8 +397,6 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - return -1; - } - -- wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf); -- - return 0; - out_free: - wpa_supplicant_mesh_deinit(wpa_s); diff --git a/recipes-connectivity/hostapd/files/003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch b/recipes-connectivity/hostapd/files/003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch deleted file mode 100644 index 6daeaa9..0000000 --- a/recipes-connectivity/hostapd/files/003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch +++ /dev/null @@ -1,104 +0,0 @@ -From be06b10b0a20f8de769d8b0ea983eaf94e0aefbc Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:19 +0200 -Subject: [PATCH] wpa_supplicant: handle HT40 and mode downgrade in AP mode - -This patch adds some missing pieces to the interface configuration -of AP/mesh mode in wpa_supplicant. - - check for secondary channel and HT40 capability - - try to downgrade to 11b if 11g is not available -Especially with the HT40 check, this code now performs all settings, -which the deleted/duplicated mesh code did. - -Signed-off-by: Markus Theil - ---- - wpa_supplicant/ap.c | 49 ++++++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 40 insertions(+), 9 deletions(-) - -diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c -index 5b75821a2..156c1aab1 100644 ---- a/wpa_supplicant/ap.c -+++ b/wpa_supplicant/ap.c -@@ -134,6 +134,23 @@ no_vht: - } - - -+static struct hostapd_hw_modes *wpa_supplicant_find_hw_mode(struct wpa_supplicant *wpa_s, -+ enum hostapd_hw_mode hw_mode) -+{ -+ struct hostapd_hw_modes *mode = NULL; -+ int i; -+ -+ for (i = 0; i < wpa_s->hw.num_modes; i++) { -+ if (wpa_s->hw.modes[i].mode == hw_mode) { -+ mode = &wpa_s->hw.modes[i]; -+ break; -+ } -+ } -+ -+ return mode; -+} -+ -+ - int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, - struct wpa_ssid *ssid, - struct hostapd_config *conf) -@@ -147,9 +164,6 @@ int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, - return -1; - } - -- /* TODO: enable HT40 if driver supports it; -- * drop to 11b if driver does not support 11g */ -- - /* - * Enable HT20 if the driver supports it, by setting conf->ieee80211n - * and a mask of allowed capabilities within conf->ht_capab. -@@ -158,17 +172,27 @@ int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, - */ - if (wpa_s->hw.modes) { - struct hostapd_hw_modes *mode = NULL; -- int i, no_ht = 0; -+ int no_ht = 0; - - wpa_printf(MSG_DEBUG, - "Determining HT/VHT options based on driver capabilities (freq=%u chan=%u)", - ssid->frequency, conf->channel); - -- for (i = 0; i < wpa_s->hw.num_modes; i++) { -- if (wpa_s->hw.modes[i].mode == conf->hw_mode) { -- mode = &wpa_s->hw.modes[i]; -- break; -- } -+ mode = wpa_supplicant_find_hw_mode(wpa_s, conf->hw_mode); -+ -+ /* may drop drop to 11b if driver does not support 11g */ -+ if (!mode && conf->hw_mode == HOSTAPD_MODE_IEEE80211G) { -+ conf->hw_mode = HOSTAPD_MODE_IEEE80211B; -+ wpa_printf(MSG_INFO, -+ "Try downgrade to IEEE 802.11b as 802.11g is not " -+ "supported by the current hardware"); -+ mode = wpa_supplicant_find_hw_mode(wpa_s, conf->hw_mode); -+ } -+ -+ if (!mode) { -+ wpa_printf(MSG_ERROR, -+ "No match between requested and supported hw modes found"); -+ return -1; - } - - #ifdef CONFIG_HT_OVERRIDES -@@ -193,6 +217,13 @@ int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, - HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET), - ssid->ht40); - conf->ieee80211n = 1; -+ -+ if (ssid->ht40 && -+ mode->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) -+ conf->secondary_channel = ssid->ht40; -+ else -+ conf->secondary_channel = 0; -+ - #ifdef CONFIG_P2P - if (ssid->p2p_group && - conf->hw_mode == HOSTAPD_MODE_IEEE80211A && diff --git a/recipes-connectivity/hostapd/files/004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch b/recipes-connectivity/hostapd/files/004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch deleted file mode 100644 index 1265934..0000000 --- a/recipes-connectivity/hostapd/files/004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 356b59ecd1db87a74248dab97034c39ff5fa316a Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:20 +0200 -Subject: [PATCH] wpa_supplicant: fix frequency config for non p2p vht/he cases - -Fix compile without CONFIG_P2P and only set secondary channel seg idx -if we use a mode supporting a sec channel for vht/he. - -Signed-off-by: Markus Theil - ---- - wpa_supplicant/ap.c | 23 +++++++++++++---------- - 1 file changed, 13 insertions(+), 10 deletions(-) - -diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c -index 156c1aab1..2ec656255 100644 ---- a/wpa_supplicant/ap.c -+++ b/wpa_supplicant/ap.c -@@ -52,8 +52,8 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s, - #ifdef CONFIG_P2P - u8 center_chan = 0; - u8 channel = conf->channel; -- u8 freq_seg_idx; - #endif /* CONFIG_P2P */ -+ u8 freq_seg_idx; - - if (!conf->secondary_channel) - goto no_vht; -@@ -62,24 +62,27 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s, - if (ssid->max_oper_chwidth) - hostapd_set_oper_chwidth(conf, ssid->max_oper_chwidth); - -- ieee80211_freq_to_chan(ssid->vht_center_freq2, -- &freq_seg_idx); -- hostapd_set_oper_centr_freq_seg1_idx(conf, freq_seg_idx); -- - if (!ssid->p2p_group) { -- if (!ssid->vht_center_freq1 || -- hostapd_get_oper_chwidth(conf) == CHANWIDTH_USE_HT) -+ if (!ssid->vht_center_freq1) - goto no_vht; - ieee80211_freq_to_chan(ssid->vht_center_freq1, - &freq_seg_idx); - hostapd_set_oper_centr_freq_seg0_idx(conf, freq_seg_idx); -- wpa_printf(MSG_DEBUG, "VHT seg0 index %d for AP", -- hostapd_get_oper_centr_freq_seg0_idx(conf)); -+ -+ if (hostapd_get_oper_chwidth(conf) == CHANWIDTH_80P80MHZ) { -+ ieee80211_freq_to_chan(ssid->vht_center_freq2, -+ &freq_seg_idx); -+ hostapd_set_oper_centr_freq_seg1_idx(conf, freq_seg_idx); -+ } -+ -+ wpa_printf(MSG_DEBUG, "VHT seg0 index %d and seg1 index %d for AP", -+ hostapd_get_oper_centr_freq_seg0_idx(conf), -+ hostapd_get_oper_centr_freq_seg1_idx(conf)); - return; - } - - #ifdef CONFIG_P2P -- switch (conf->vht_oper_chwidth) { -+ switch (hostapd_get_oper_chwidth(conf)) { - case CHANWIDTH_80MHZ: - case CHANWIDTH_80P80MHZ: - center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, channel); diff --git a/recipes-connectivity/hostapd/files/005-wpa_supplicant-enable-vht-and-he-in-default-config-p.patch b/recipes-connectivity/hostapd/files/005-wpa_supplicant-enable-vht-and-he-in-default-config-p.patch deleted file mode 100644 index cf91b2f..0000000 --- a/recipes-connectivity/hostapd/files/005-wpa_supplicant-enable-vht-and-he-in-default-config-p.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a154b97c65c8b22755e326863770b498617148a9 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:21 +0200 -Subject: [PATCH] wpa_supplicant: enable vht and he in default config - parameters - -Enable VHT and HE as default config parameters in order for -wpa_supplicant AP mode to use it, if hw support is given. - -Signed-off-by: Markus Theil - ---- - wpa_supplicant/config.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index a9726e2d6..58c53cdb3 100644 ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c -@@ -3036,6 +3036,8 @@ void wpa_config_set_network_defaults(struct wpa_ssid *ssid) - ssid->wpa_deny_ptk0_rekey = PTK0_REKEY_ALLOW_ALWAYS; - ssid->bg_scan_period = DEFAULT_BG_SCAN_PERIOD; - ssid->ht = 1; -+ ssid->vht = 1; -+ ssid->he = 1; - #ifdef IEEE8021X_EAPOL - ssid->eapol_flags = DEFAULT_EAPOL_FLAGS; - ssid->eap_workaround = DEFAULT_EAP_WORKAROUND; diff --git a/recipes-connectivity/hostapd/files/006-hw_features-better-debug-messages-for-some-error-cas.patch b/recipes-connectivity/hostapd/files/006-hw_features-better-debug-messages-for-some-error-cas.patch deleted file mode 100644 index 18a63b1..0000000 --- a/recipes-connectivity/hostapd/files/006-hw_features-better-debug-messages-for-some-error-cas.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 0464c6d1f8b205ca7d3a2f8b2dc5f81cc88c861b Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:22 +0200 -Subject: [PATCH] hw_features: better debug messages for some error cases - -Signed-off-by: Markus Theil - ---- - src/common/hw_features_common.c | 29 ++++++++++++++++++++++------- - 1 file changed, 22 insertions(+), 7 deletions(-) - -diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c -index f6c67a375..3de8eb9cf 100644 ---- a/src/common/hw_features_common.c -+++ b/src/common/hw_features_common.c -@@ -540,13 +540,18 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data, - if (center_segment1 || - (center_segment0 != 0 && - 5000 + center_segment0 * 5 != data->center_freq1 && -- 2407 + center_segment0 * 5 != data->center_freq1)) -+ 2407 + center_segment0 * 5 != data->center_freq1)) { -+ wpa_printf(MSG_ERROR, "20/40 MHz: center segment 0 (=%i) and center freq 1 (=%i) not in sync", -+ center_segment0, data->center_freq1); - return -1; -+ } - break; - case CHANWIDTH_80P80MHZ: - if (center_segment1 == center_segment0 + 4 || -- center_segment1 == center_segment0 - 4) -+ center_segment1 == center_segment0 - 4) { -+ wpa_printf(MSG_ERROR, "80+80 MHz: center segment 1 only 20 MHz apart"); - return -1; -+ } - data->center_freq2 = 5000 + center_segment1 * 5; - /* fall through */ - case CHANWIDTH_80MHZ: -@@ -555,8 +560,10 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data, - center_segment1) || - (oper_chwidth == CHANWIDTH_80P80MHZ && - !center_segment1) || -- !sec_channel_offset) -+ !sec_channel_offset) { -+ wpa_printf(MSG_ERROR, "80/80+80 MHz: center segment 1 wrong or no second channel offset"); - return -1; -+ } - if (!center_segment0) { - if (channel <= 48) - center_segment0 = 42; -@@ -582,16 +589,22 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data, - center_segment0 == channel - 2 || - center_segment0 == channel - 6) - data->center_freq1 = 5000 + center_segment0 * 5; -- else -+ else { -+ wpa_printf(MSG_ERROR, "Wrong coupling between HT and VHT/HE channel setting"); - return -1; -+ } - } - break; - case CHANWIDTH_160MHZ: - data->bandwidth = 160; -- if (center_segment1) -+ if (center_segment1) { -+ wpa_printf(MSG_ERROR, "160 MHz: center segment 1 should not be set"); - return -1; -- if (!sec_channel_offset) -+ } -+ if (!sec_channel_offset) { -+ wpa_printf(MSG_ERROR, "160 MHz: second channel offset not set"); - return -1; -+ } - /* - * Note: HT/VHT config and params are coupled. Check if - * HT40 channel band is in VHT160 channel band configuration. -@@ -605,8 +618,10 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data, - center_segment0 == channel - 10 || - center_segment0 == channel - 14) - data->center_freq1 = 5000 + center_segment0 * 5; -- else -+ else { -+ wpa_printf(MSG_ERROR, "160 MHz: HT40 channel band is not in 160 MHz band"); - return -1; -+ } - break; - } - diff --git a/recipes-connectivity/hostapd/files/007-dfs-use-helper-functions-for-vht-he-parameters.patch b/recipes-connectivity/hostapd/files/007-dfs-use-helper-functions-for-vht-he-parameters.patch deleted file mode 100644 index ed4573d..0000000 --- a/recipes-connectivity/hostapd/files/007-dfs-use-helper-functions-for-vht-he-parameters.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 1111a73ca0b0f7e8ed08faf4fa317502bbc2d062 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 13:53:23 +0200 -Subject: [PATCH] dfs: use helper functions for vht/he parameters - -Signed-off-by: Markus Theil - ---- - src/ap/dfs.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/ap/dfs.c b/src/ap/dfs.c -index f62da49a7..2c914baa2 100644 ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -955,10 +955,12 @@ dfs_downgrade_bandwidth(struct hostapd_iface *iface, int *secondary_channel, - if (*skip_radar) { - *skip_radar = 0; - } else { -- if (iface->conf->vht_oper_chwidth == CHANWIDTH_USE_HT) -+ int oper_chwidth = hostapd_get_oper_chwidth(iface->conf); -+ -+ if (oper_chwidth == CHANWIDTH_USE_HT) - break; - *skip_radar = 1; -- iface->conf->vht_oper_chwidth--; -+ hostapd_set_oper_chwidth(iface->conf, oper_chwidth - 1); - } - } - diff --git a/recipes-connectivity/hostapd/files/008-mesh-use-setup-completion-callback-to-complete-mesh-.patch b/recipes-connectivity/hostapd/files/008-mesh-use-setup-completion-callback-to-complete-mesh-.patch deleted file mode 100644 index 849f062..0000000 --- a/recipes-connectivity/hostapd/files/008-mesh-use-setup-completion-callback-to-complete-mesh-.patch +++ /dev/null @@ -1,112 +0,0 @@ -From d6ef413782540a3d20d1ffb871dd7c8138b001af Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:18:56 +0200 -Subject: [PATCH] mesh: use setup completion callback to complete mesh join - -mesh join function is the last function to be called during -mesh join process, but it's been called a bit earlier than -it's supposed to be, so that some mesh parameter values -such as VHT capabilities not applied correct when mesh join -is in process. -Moreover current design of mesh join that is called directly -after mesh initialization isn't suitable for DFS channels to use, -since mesh join process should be paused until DFS CAC is -done and resumed after it's done. -The callback will be called by hostapd_setup_interface_complete_sync. -There is possiblity that completing mesh init fails, so add error -handle codes. - -Signed-off-by: Peter Oh - ---- - src/ap/hostapd.c | 11 ++++++++++- - wpa_supplicant/mesh.c | 12 ++++++++++-- - 2 files changed, 20 insertions(+), 3 deletions(-) - -diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index b37f49f9a..04aebe31a 100644 ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -434,6 +434,8 @@ static void hostapd_free_hapd_data(struct hostapd_data *hapd) - #ifdef CONFIG_MESH - wpabuf_free(hapd->mesh_pending_auth); - hapd->mesh_pending_auth = NULL; -+ /* handling setup failure is already done */ -+ hapd->setup_complete_cb = NULL; - #endif /* CONFIG_MESH */ - - hostapd_clean_rrm(hapd); -@@ -2156,6 +2158,13 @@ dfs_offload: - if (hapd->setup_complete_cb) - hapd->setup_complete_cb(hapd->setup_complete_cb_ctx); - -+#ifdef CONFIG_MESH -+ if (delay_apply_cfg && iface->mconf == NULL) { -+ wpa_printf(MSG_ERROR, "Error while completing mesh init"); -+ goto fail; -+ } -+#endif /* CONFIG_MESH */ -+ - wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", - iface->bss[0]->conf->iface); - if (iface->interfaces && iface->interfaces->terminate_on_error > 0) -@@ -2299,7 +2308,7 @@ int hostapd_setup_interface(struct hostapd_iface *iface) - ret = setup_interface(iface); - if (ret) { - wpa_printf(MSG_ERROR, "%s: Unable to setup interface.", -- iface->bss[0]->conf->iface); -+ iface->conf ? iface->conf->bss[0]->iface : "N/A"); - return -1; - } - -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 941c95cfd..1453bdc01 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -193,7 +193,6 @@ static int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s) - return !wpa_s->mesh_rsn ? -1 : 0; - } - -- - static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - { - struct hostapd_iface *ifmsh = wpa_s->ifmsh; -@@ -244,6 +243,13 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - } - - -+static void wpas_mesh_complete_cb(void *arg) -+{ -+ struct wpa_supplicant *wpa_s = arg; -+ wpas_mesh_complete(wpa_s); -+} -+ -+ - static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - struct wpa_ssid *ssid, - struct hostapd_freq_params *freq) -@@ -267,6 +273,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - if (!ifmsh) - return -ENOMEM; - -+ ifmsh->owner = wpa_s; - ifmsh->drv_flags = wpa_s->drv_flags; - ifmsh->drv_flags2 = wpa_s->drv_flags2; - ifmsh->num_bss = 1; -@@ -285,6 +292,8 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - bss->drv_priv = wpa_s->drv_priv; - bss->iface = ifmsh; - bss->mesh_sta_free_cb = mesh_mpm_free_sta; -+ bss->setup_complete_cb = wpas_mesh_complete_cb; -+ bss->setup_complete_cb_ctx = wpa_s; - frequency = ssid->frequency; - if (frequency != freq->freq && - frequency == freq->freq + freq->sec_channel_offset * 20) { -@@ -523,7 +532,6 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, - goto out; - } - -- ret = wpas_mesh_complete(wpa_s); - out: - return ret; - } diff --git a/recipes-connectivity/hostapd/files/009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch b/recipes-connectivity/hostapd/files/009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch deleted file mode 100644 index 56c948b..0000000 --- a/recipes-connectivity/hostapd/files/009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 9b1c3fe0c25e34cde263048705413b20e01c9cf0 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:18:57 +0200 -Subject: [PATCH] mesh: update ssid->frequency as pri/sec channel switch - -ssid->frequency is one of variables used to gets channel -number from given frequency. Leave it as unchanged when -pri/sec channel switched will cause picking up wrong -channel number after applying secondary channel offset -for HT40 and leads failing interface bring-up. - -Signed-off-by: Peter Oh - ---- - wpa_supplicant/mesh.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 1453bdc01..778541bc0 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -299,6 +299,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - frequency == freq->freq + freq->sec_channel_offset * 20) { - wpa_printf(MSG_DEBUG, "mesh: pri/sec channels switched"); - frequency = freq->freq; -+ ssid->frequency = frequency; - } - wpa_s->assoc_freq = frequency; - wpa_s->current_ssid = ssid; diff --git a/recipes-connectivity/hostapd/files/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch b/recipes-connectivity/hostapd/files/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch index 77893b6..e2e163b 100644 --- a/recipes-connectivity/hostapd/files/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch +++ b/recipes-connectivity/hostapd/files/010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch @@ -1,4 +1,4 @@ -From 5faeb01ac83cf6fcb7a335c0df1b6e04683c5d40 Mon Sep 17 00:00:00 2001 +From 4b6c9580dae47d20f429f0e2738183969acf29b8 Mon Sep 17 00:00:00 2001 From: Peter Oh Date: Tue, 30 Jun 2020 14:18:58 +0200 Subject: [PATCH] mesh: Allow DFS channels to be selected if dfs is enabled @@ -9,23 +9,44 @@ Signed-off-by: Benjamin Berg Signed-off-by: Peter Oh --- - wpa_supplicant/wpa_supplicant.c | 25 +++++++++++++++++++------ - 1 file changed, 19 insertions(+), 6 deletions(-) + wpa_supplicant/wpa_supplicant.c | 31 ++++++++++++++++++++++--------- + 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index f5a4c360b..79273db5d 100644 +index cf68417ca..fb47942c9 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2349,6 +2349,8 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, +@@ -2425,7 +2425,7 @@ static int drv_supports_vht(struct wpa_supplicant *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; + +@@ -2434,7 +2434,10 @@ static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode) + + 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; + } + +@@ -2463,6 +2466,8 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, int chwidth, seg0, seg1; u32 vht_caps = 0; - 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_supplicant *wpa_s, +@@ -2559,8 +2564,11 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, return; /* Check primary channel flags */ @@ -38,7 +59,7 @@ index f5a4c360b..79273db5d 100644 freq->channel = pri_chan->chan; -@@ -2470,8 +2475,11 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, +@@ -2593,8 +2601,11 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, return; /* Check secondary channel flags */ @@ -51,20 +72,25 @@ index f5a4c360b..79273db5d 100644 if (ht40 == -1) { if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS)) -@@ -2564,8 +2572,11 @@ skip_ht40: - return; +@@ -2683,7 +2694,7 @@ skip_to_6ghz: + return; - /* Back to HT configuration if channel not usable */ -- if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR)) -+ if (chan->flag & HOSTAPD_CHAN_DISABLED) - return; -+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR)) -+ if (!dfs_enabled) -+ return; - } + /* 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: +@@ -2697,7 +2708,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++) { +@@ -2727,10 +2738,12 @@ skip_to_6ghz: if (!chan) continue; diff --git a/recipes-connectivity/hostapd/files/011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch b/recipes-connectivity/hostapd/files/011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch deleted file mode 100644 index ce7871e..0000000 --- a/recipes-connectivity/hostapd/files/011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 3e1edb5f0673e87eaa68a45678578046dde10f0f Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:18:59 +0200 -Subject: [PATCH] mesh: do not set offchanok on DFS channels in non-ETSI - -mac80211 does not allow mgmt tx to use off channel on -DFS channels in non-ETSI domain, because it will invalidate -CAC result on current operating channel. -(mac80211 commit: 34373d12f3cbb74960a73431138ef619d857996f) -Hence don't set offchanok for mgmt tx in case of DFS channels -in non-ETSI. - -Signed-off-by: Peter Oh - ---- - src/drivers/driver_nl80211.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 72189da24..6a612a4cb 100644 ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -7788,7 +7788,11 @@ static int wpa_driver_nl80211_send_action(struct i802_bss *bss, - int ret = -1; - u8 *buf; - struct ieee80211_hdr *hdr; -+ struct hostapd_hw_modes *modes; - int offchanok = 1; -+ u16 num_modes, flags; -+ u8 dfs_domain; -+ int i; - - if (is_ap_interface(drv->nlmode) && (int) freq == bss->freq && - bss->beacon_set) -@@ -7817,6 +7821,21 @@ static int wpa_driver_nl80211_send_action(struct i802_bss *bss, - os_memset(bss->rand_addr, 0, ETH_ALEN); - } - -+ if (is_mesh_interface(drv->nlmode)) { -+ modes = nl80211_get_hw_feature_data(bss, &num_modes, -+ &flags, &dfs_domain); -+ if (dfs_domain != HOSTAPD_DFS_REGION_ETSI && -+ ieee80211_is_dfs(bss->freq, modes, num_modes)) -+ offchanok = 0; -+ if (modes) { -+ for (i = 0; i < num_modes; i++) { -+ os_free(modes[i].channels); -+ os_free(modes[i].rates); -+ } -+ os_free(modes); -+ } -+ } -+ - if (is_ap_interface(drv->nlmode) && - (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) || - (int) freq == bss->freq || drv->device_ap_sme || diff --git a/recipes-connectivity/hostapd/files/019-mesh-use-deterministic-channel-on-channel-switch.patch b/recipes-connectivity/hostapd/files/011-mesh-use-deterministic-channel-on-channel-switch.patch similarity index 84% rename from recipes-connectivity/hostapd/files/019-mesh-use-deterministic-channel-on-channel-switch.patch rename to recipes-connectivity/hostapd/files/011-mesh-use-deterministic-channel-on-channel-switch.patch index f9eaf0e..aa40214 100644 --- a/recipes-connectivity/hostapd/files/019-mesh-use-deterministic-channel-on-channel-switch.patch +++ b/recipes-connectivity/hostapd/files/011-mesh-use-deterministic-channel-on-channel-switch.patch @@ -1,4 +1,4 @@ -From d3c3fd410b1821b8ffd6179e6937f79bb8212166 Mon Sep 17 00:00:00 2001 +From 1165051d5d5d32340384a6e10f73fa763530aac9 Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Tue, 30 Jun 2020 14:19:07 +0200 Subject: [PATCH] mesh: use deterministic channel on channel switch @@ -21,7 +21,7 @@ Signed-off-by: Markus Theil 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c -index 25dad3482..8f3630bf8 100644 +index e46dd7ede..5a0d3497d 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -17,6 +17,7 @@ @@ -31,8 +31,8 @@ index 25dad3482..8f3630bf8 100644 +#include "crypto/crypto.h" - static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1) -@@ -480,9 +481,14 @@ dfs_get_valid_channel(struct hostapd_iface *iface, + enum dfs_channel_type { +@@ -515,9 +516,14 @@ dfs_get_valid_channel(struct hostapd_iface *iface, int num_available_chandefs; int chan_idx, chan_idx2; int sec_chan_idx_80p80 = -1; @@ -47,7 +47,7 @@ index 25dad3482..8f3630bf8 100644 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_iface *iface, +@@ -537,8 +543,20 @@ dfs_get_valid_channel(struct hostapd_iface *iface, if (num_available_chandefs == 0) return NULL; @@ -67,13 +67,13 @@ index 25dad3482..8f3630bf8 100644 return NULL; + chan_idx = _rand % num_available_chandefs; - dfs_find_channel(iface, &chan, chan_idx, skip_radar); + dfs_find_channel(iface, &chan, chan_idx, type); if (!chan) { diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index b218af226..3f691b21b 100644 +index 60e44a1a9..d62d685f4 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9473,6 +9473,10 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings) +@@ -9932,6 +9932,10 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings) if (ret) goto error; diff --git a/recipes-connectivity/hostapd/files/012-mesh-fix-channel-switch-error-during-CAC.patch b/recipes-connectivity/hostapd/files/012-mesh-fix-channel-switch-error-during-CAC.patch deleted file mode 100644 index fc783db..0000000 --- a/recipes-connectivity/hostapd/files/012-mesh-fix-channel-switch-error-during-CAC.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 278b1ab4385b56609b1c5a811d3a570756fb2ca6 Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:19:00 +0200 -Subject: [PATCH] mesh: fix channel switch error during CAC - -Mesh interface has used its channel parameters that configured -during its initialization even after channel switched due to -DFS radar detection during CAC which caused channel switch error. -This change fixes the error by updating its channel parameters -when channel's been changed from initial one. - -Signed-off-by: Peter Oh - ---- - wpa_supplicant/mesh.c | 34 ++++++++++++++++++++++++++++++++++ - 1 file changed, 34 insertions(+) - -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 778541bc0..15c285812 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -13,6 +13,7 @@ - #include "utils/uuid.h" - #include "common/ieee802_11_defs.h" - #include "common/wpa_ctrl.h" -+#include "common/hw_features_common.h" - #include "ap/sta_info.h" - #include "ap/hostapd.h" - #include "ap/ieee802_11.h" -@@ -206,6 +207,39 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - return -1; - } - -+ /* -+ * inspect if channel's been changed since initialized. -+ * i.e. DFS radar detection -+ */ -+ if (ifmsh->freq != params->freq.freq) { -+ wpa_s->assoc_freq = ifmsh->freq; -+ ssid->frequency = ifmsh->freq; -+ struct he_capabilities *he_capab = NULL; -+ -+ if (ifmsh->current_mode) -+ he_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH]; -+ -+ if (hostapd_set_freq_params(¶ms->freq, -+ ifmsh->conf->hw_mode, -+ ifmsh->freq, -+ ifmsh->conf->channel, -+ ifmsh->conf->enable_edmg, -+ ifmsh->conf->edmg_channel, -+ ifmsh->conf->ieee80211n, -+ ifmsh->conf->ieee80211ac, -+ ifmsh->conf->ieee80211ax, -+ ifmsh->conf->secondary_channel, -+ hostapd_get_oper_chwidth(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf), -+ ifmsh->conf->vht_capab, -+ he_capab)) { -+ wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); -+ wpa_supplicant_mesh_deinit(wpa_s); -+ return -1; -+ } -+ } -+ - if (ifmsh->mconf->security != MESH_CONF_SEC_NONE && - wpas_mesh_init_rsn(wpa_s)) { - wpa_printf(MSG_ERROR, diff --git a/recipes-connectivity/hostapd/files/013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch b/recipes-connectivity/hostapd/files/013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch deleted file mode 100644 index cf2d288..0000000 --- a/recipes-connectivity/hostapd/files/013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch +++ /dev/null @@ -1,55 +0,0 @@ -From b82a67a4ac91e8146ba10456e178a91c547becde Mon Sep 17 00:00:00 2001 -From: Peter Oh -Date: Tue, 30 Jun 2020 14:19:01 +0200 -Subject: [PATCH] mesh: inform kernel driver DFS handler in userspace - -NL80211_ATTR_HANDLE_DFS is required by kerenel space -to enable DFS channels that indicates DFS handler -resides in userspace. - -Signed-off-by: Peter Oh - ---- - src/drivers/driver.h | 1 + - src/drivers/driver_nl80211.c | 3 +++ - wpa_supplicant/mesh.c | 1 + - 3 files changed, 5 insertions(+) - -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 350c1cb57..49a580077 100644 ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -1542,6 +1542,7 @@ struct wpa_driver_mesh_join_params { - #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004 - #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 - unsigned int flags; -+ u8 handle_dfs; - }; - - struct wpa_driver_set_key_params { -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 6a612a4cb..b218af226 100644 ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -10070,6 +10070,9 @@ static int nl80211_join_mesh(struct i802_bss *bss, - - wpa_printf(MSG_DEBUG, " * flags=%08X", params->flags); - -+ if (params->handle_dfs) -+ if (nla_put_flag(msg, NL80211_ATTR_HANDLE_DFS)) -+ goto fail; - container = nla_nest_start(msg, NL80211_ATTR_MESH_SETUP); - if (!container) - goto fail; -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 15c285812..c350e762b 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -355,6 +355,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - conf->country[0] = wpa_s->conf->country[0]; - conf->country[1] = wpa_s->conf->country[1]; - conf->country[2] = ' '; -+ wpa_s->mesh_params->handle_dfs = 1; - } - - bss->iconf = conf; diff --git a/recipes-connectivity/hostapd/files/014-mesh-fixes-for-mesh-init-deinit.patch b/recipes-connectivity/hostapd/files/014-mesh-fixes-for-mesh-init-deinit.patch deleted file mode 100644 index 561d6e7..0000000 --- a/recipes-connectivity/hostapd/files/014-mesh-fixes-for-mesh-init-deinit.patch +++ /dev/null @@ -1,165 +0,0 @@ -From fc6bdc02c7db6fd409c099bdb18d919fb9e8248e Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:02 +0200 -Subject: [PATCH] mesh: fixes for mesh init/deinit - -Send mesh group started notification after join completion -callback is called. - -Implement outstanding TODO, to leave the mesh network on deinit. - -Signed-off-by: Markus Theil - ---- - wpa_supplicant/mesh.c | 32 ++++++++++++++++++++------------ - wpa_supplicant/mesh.h | 6 ++++-- - wpa_supplicant/wpa_supplicant.c | 8 ++------ - 3 files changed, 26 insertions(+), 20 deletions(-) - -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index c350e762b..5eb2a29d5 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -30,20 +30,20 @@ - - static void wpa_supplicant_mesh_deinit(struct wpa_supplicant *wpa_s) - { -- wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh); -+ wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, true); - wpa_s->ifmsh = NULL; - wpa_s->current_ssid = NULL; - os_free(wpa_s->mesh_rsn); - wpa_s->mesh_rsn = NULL; - os_free(wpa_s->mesh_params); - wpa_s->mesh_params = NULL; -- /* TODO: leave mesh (stop beacon). This will happen on link down -- * anyway, so it's not urgent */ -+ wpa_supplicant_leave_mesh(wpa_s, false); - } - - - void wpa_supplicant_mesh_iface_deinit(struct wpa_supplicant *wpa_s, -- struct hostapd_iface *ifmsh) -+ struct hostapd_iface *ifmsh, -+ bool also_clear_hostapd) - { - if (!ifmsh) - return; -@@ -64,8 +64,10 @@ void wpa_supplicant_mesh_iface_deinit(struct wpa_supplicant *wpa_s, - } - - /* take care of shared data */ -- hostapd_interface_deinit(ifmsh); -- hostapd_interface_free(ifmsh); -+ if (also_clear_hostapd) { -+ hostapd_interface_deinit(ifmsh); -+ hostapd_interface_free(ifmsh); -+ } - } - - -@@ -244,8 +246,7 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - wpas_mesh_init_rsn(wpa_s)) { - wpa_printf(MSG_ERROR, - "mesh: RSN initialization failed - deinit mesh"); -- wpa_supplicant_mesh_deinit(wpa_s); -- wpa_drv_leave_mesh(wpa_s); -+ wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, false); - return -1; - } - -@@ -270,9 +271,15 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - /* hostapd sets the interface down until we associate */ - wpa_drv_set_operstate(wpa_s, 1); - -- if (!ret) -+ if (!ret) { - wpa_supplicant_set_state(wpa_s, WPA_COMPLETED); - -+ wpa_msg(wpa_s, MSG_INFO, MESH_GROUP_STARTED "ssid=\"%s\" id=%d", -+ wpa_ssid_txt(ssid->ssid, ssid->ssid_len), -+ ssid->id); -+ wpas_notify_mesh_group_started(wpa_s, ssid); -+ } -+ - return ret; - } - -@@ -563,7 +570,7 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, - wpa_s->mesh_params = params; - if (wpa_supplicant_mesh_init(wpa_s, ssid, ¶ms->freq)) { - wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh"); -- wpa_drv_leave_mesh(wpa_s); -+ wpa_supplicant_leave_mesh(wpa_s, true); - ret = -1; - goto out; - } -@@ -573,14 +580,15 @@ out: - } - - --int wpa_supplicant_leave_mesh(struct wpa_supplicant *wpa_s) -+int wpa_supplicant_leave_mesh(struct wpa_supplicant *wpa_s, bool need_deinit) - { - int ret = 0; - - wpa_msg(wpa_s, MSG_INFO, "leaving mesh"); - - /* Need to send peering close messages first */ -- wpa_supplicant_mesh_deinit(wpa_s); -+ if (need_deinit) -+ wpa_supplicant_mesh_deinit(wpa_s); - - ret = wpa_drv_leave_mesh(wpa_s); - if (ret) -diff --git a/wpa_supplicant/mesh.h b/wpa_supplicant/mesh.h -index 7317083c9..a429e5e27 100644 ---- a/wpa_supplicant/mesh.h -+++ b/wpa_supplicant/mesh.h -@@ -11,9 +11,11 @@ - - int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, - struct wpa_ssid *ssid); --int wpa_supplicant_leave_mesh(struct wpa_supplicant *wpa_s); -+int wpa_supplicant_leave_mesh(struct wpa_supplicant *wpa_s, -+ bool need_deinit); - void wpa_supplicant_mesh_iface_deinit(struct wpa_supplicant *wpa_s, -- struct hostapd_iface *ifmsh); -+ struct hostapd_iface *ifmsh, -+ bool also_clear_hostapd); - int wpas_mesh_scan_result_text(const u8 *ies, size_t ies_len, char *buf, - char *end); - int wpas_mesh_add_interface(struct wpa_supplicant *wpa_s, char *ifname, -diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index 79273db5d..91ad7819b 100644 ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -2225,10 +2225,6 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, - return; - } - wpa_s->current_bss = bss; -- wpa_msg(wpa_s, MSG_INFO, MESH_GROUP_STARTED "ssid=\"%s\" id=%d", -- wpa_ssid_txt(ssid->ssid, ssid->ssid_len), -- ssid->id); -- wpas_notify_mesh_group_started(wpa_s, ssid); - #else /* CONFIG_MESH */ - wpa_msg(wpa_s, MSG_ERROR, - "mesh mode support not included in the build"); -@@ -3938,7 +3934,7 @@ void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s, - wpa_s->ifname); - wpas_notify_mesh_group_removed(wpa_s, mconf->meshid, - mconf->meshid_len, reason_code); -- wpa_supplicant_leave_mesh(wpa_s); -+ wpa_supplicant_leave_mesh(wpa_s, true); - } - #endif /* CONFIG_MESH */ - -@@ -6551,7 +6547,7 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s, - - #ifdef CONFIG_MESH - if (wpa_s->ifmsh) { -- wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh); -+ wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, true); - wpa_s->ifmsh = NULL; - } - #endif /* CONFIG_MESH */ diff --git a/recipes-connectivity/hostapd/files/015-mesh-fix-DFS-deinit-init.patch b/recipes-connectivity/hostapd/files/015-mesh-fix-DFS-deinit-init.patch deleted file mode 100644 index 90e3599..0000000 --- a/recipes-connectivity/hostapd/files/015-mesh-fix-DFS-deinit-init.patch +++ /dev/null @@ -1,271 +0,0 @@ -From d9d21373d053fa62d459a09e68ed66cfdc95c1a4 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:03 +0200 -Subject: [PATCH] mesh: fix DFS deinit/init - -The hostapd DFS code deinitializes and initializes the -AP interface, if a clean channel switch is not possible. -In this case the AP code paths would deinit the driver, for -example nl80211, without wpa_supplicant code paths getting -notice of this. - -Therefore add callbacks for wpa_supplicant mesh methods, -which are called on init/deinit of the AP bss. These -callbacks are then used to handle the reset in the mesh -code. - -Signed-off-by: Markus Theil - ---- - src/ap/dfs.c | 2 +- - src/ap/hostapd.c | 17 ++++++++-- - src/ap/hostapd.h | 6 ++++ - wpa_supplicant/mesh.c | 90 ++++++++++++++++++++++++++++++++++++++++++++------- - 4 files changed, 100 insertions(+), 15 deletions(-) - -diff --git a/src/ap/dfs.c b/src/ap/dfs.c -index 2c914baa2..25dad3482 100644 ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -1112,7 +1112,7 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) - oper_centr_freq_seg0_idx, - oper_centr_freq_seg1_idx, - cmode->vht_capab, -- &cmode->he_capab[IEEE80211_MODE_AP]); -+ &cmode->he_capab[iface->conf->hw_mode]); - - if (err) { - wpa_printf(MSG_ERROR, "DFS failed to calculate CSA freq params"); -diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index 04aebe31a..1579ae7fe 100644 ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -354,7 +354,7 @@ static int hostapd_broadcast_wep_set(struct hostapd_data *hapd) - #endif /* CONFIG_WEP */ - - --static void hostapd_free_hapd_data(struct hostapd_data *hapd) -+void hostapd_free_hapd_data(struct hostapd_data *hapd) - { - os_free(hapd->probereq_cb); - hapd->probereq_cb = NULL; -@@ -498,7 +498,7 @@ static void sta_track_deinit(struct hostapd_iface *iface) - } - - --static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) -+void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) - { - wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); - #ifdef NEED_AP_MLME -@@ -626,7 +626,7 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason) - } - - --static void hostapd_bss_deinit_no_free(struct hostapd_data *hapd) -+void hostapd_bss_deinit_no_free(struct hostapd_data *hapd) - { - hostapd_free_stas(hapd); - hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING); -@@ -2690,6 +2690,13 @@ int hostapd_enable_iface(struct hostapd_iface *hapd_iface) - { - size_t j; - -+ if (hapd_iface == NULL) -+ return -1; -+ -+ if (hapd_iface->enable_iface_cb != NULL) { -+ return hapd_iface->enable_iface_cb(hapd_iface); -+ } -+ - if (hapd_iface->bss[0]->drv_priv != NULL) { - wpa_printf(MSG_ERROR, "Interface %s already enabled", - hapd_iface->conf->bss[0]->iface); -@@ -2751,6 +2758,10 @@ int hostapd_disable_iface(struct hostapd_iface *hapd_iface) - if (hapd_iface == NULL) - return -1; - -+ if (hapd_iface->disable_iface_cb != NULL) { -+ return hapd_iface->disable_iface_cb(hapd_iface); -+ } -+ - if (hapd_iface->bss[0]->drv_priv == NULL) { - wpa_printf(MSG_INFO, "Interface %s already disabled", - hapd_iface->conf->bss[0]->iface); -diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h -index b70d13fba..4ce31416d 100644 ---- a/src/ap/hostapd.h -+++ b/src/ap/hostapd.h -@@ -589,6 +589,9 @@ struct hostapd_iface { - - /* Previous WMM element information */ - struct hostapd_wmm_ac_params prev_wmm[WMM_AC_NUM]; -+ -+ int (*enable_iface_cb)(struct hostapd_iface *iface); -+ int (*disable_iface_cb)(struct hostapd_iface *iface); - }; - - /* hostapd.c */ -@@ -617,6 +620,9 @@ void hostapd_interface_deinit_free(struct hostapd_iface *iface); - int hostapd_enable_iface(struct hostapd_iface *hapd_iface); - int hostapd_reload_iface(struct hostapd_iface *hapd_iface); - int hostapd_disable_iface(struct hostapd_iface *hapd_iface); -+void hostapd_bss_deinit_no_free(struct hostapd_data *hapd); -+void hostapd_free_hapd_data(struct hostapd_data *hapd); -+void hostapd_cleanup_iface_partial(struct hostapd_iface *iface); - int hostapd_add_iface(struct hapd_interfaces *ifaces, char *buf); - int hostapd_remove_iface(struct hapd_interfaces *ifaces, char *buf); - void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator); -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 5eb2a29d5..81abc5c40 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -28,15 +28,20 @@ - #include "mesh.h" - - --static void wpa_supplicant_mesh_deinit(struct wpa_supplicant *wpa_s) -+static void wpa_supplicant_mesh_deinit(struct wpa_supplicant *wpa_s, bool also_clear_hostapd) - { -- wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, true); -- wpa_s->ifmsh = NULL; -- wpa_s->current_ssid = NULL; -+ wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, also_clear_hostapd); -+ -+ if (also_clear_hostapd) { -+ wpa_s->ifmsh = NULL; -+ wpa_s->current_ssid = NULL; -+ os_free(wpa_s->mesh_params); -+ wpa_s->mesh_params = NULL; -+ } -+ - os_free(wpa_s->mesh_rsn); - wpa_s->mesh_rsn = NULL; -- os_free(wpa_s->mesh_params); -- wpa_s->mesh_params = NULL; -+ - wpa_supplicant_leave_mesh(wpa_s, false); - } - -@@ -237,7 +242,7 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - ifmsh->conf->vht_capab, - he_capab)) { - wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); -- wpa_supplicant_mesh_deinit(wpa_s); -+ wpa_supplicant_mesh_deinit(wpa_s, true); - return -1; - } - } -@@ -246,7 +251,7 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - wpas_mesh_init_rsn(wpa_s)) { - wpa_printf(MSG_ERROR, - "mesh: RSN initialization failed - deinit mesh"); -- wpa_supplicant_mesh_iface_deinit(wpa_s, wpa_s->ifmsh, false); -+ wpa_supplicant_mesh_deinit(wpa_s, false); - return -1; - } - -@@ -291,6 +296,67 @@ static void wpas_mesh_complete_cb(void *arg) - } - - -+static int wpa_supplicant_mesh_enable_iface_cb(struct hostapd_iface *ifmsh) -+{ -+ struct wpa_supplicant *wpa_s = ifmsh->owner; -+ struct hostapd_data *bss; -+ -+ ifmsh->mconf = mesh_config_create(wpa_s, wpa_s->current_ssid); -+ -+ bss = ifmsh->bss[0]; -+ bss->msg_ctx = wpa_s; -+ os_memcpy(bss->own_addr, wpa_s->own_addr, ETH_ALEN); -+ bss->driver = wpa_s->driver; -+ bss->drv_priv = wpa_s->drv_priv; -+ bss->iface = ifmsh; -+ bss->mesh_sta_free_cb = mesh_mpm_free_sta; -+ bss->setup_complete_cb = wpas_mesh_complete_cb; -+ bss->setup_complete_cb_ctx = wpa_s; -+ -+ bss->conf->start_disabled = 1; -+ bss->conf->mesh = MESH_ENABLED; -+ bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity; -+ -+ if (wpa_drv_init_mesh(wpa_s)) { -+ wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh in driver"); -+ return -1; -+ } -+ -+ if (hostapd_setup_interface(ifmsh)) { -+ wpa_printf(MSG_ERROR, -+ "Failed to initialize hostapd interface for mesh"); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ -+static int wpa_supplicant_mesh_disable_iface_cb(struct hostapd_iface *ifmsh) -+{ -+ struct wpa_supplicant *wpa_s = ifmsh->owner; -+ int j; -+ -+ wpa_supplicant_mesh_deinit(wpa_s, false); -+ -+#ifdef NEED_AP_MLME -+ for (j = 0; j < ifmsh->num_bss; j++) -+ hostapd_cleanup_cs_params(ifmsh->bss[j]); -+#endif /* NEED_AP_MLME */ -+ -+ /* same as hostapd_interface_deinit without deinitializing ctrl-iface */ -+ for (j = 0; j < ifmsh->num_bss; j++) { -+ struct hostapd_data *hapd = ifmsh->bss[j]; -+ hostapd_bss_deinit_no_free(hapd); -+ hostapd_free_hapd_data(hapd); -+ } -+ -+ hostapd_cleanup_iface_partial(ifmsh); -+ -+ return 0; -+} -+ -+ - static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - struct wpa_ssid *ssid, - struct hostapd_freq_params *freq) -@@ -318,6 +384,8 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - ifmsh->drv_flags = wpa_s->drv_flags; - ifmsh->drv_flags2 = wpa_s->drv_flags2; - ifmsh->num_bss = 1; -+ ifmsh->enable_iface_cb = wpa_supplicant_mesh_enable_iface_cb; -+ ifmsh->disable_iface_cb = wpa_supplicant_mesh_disable_iface_cb; - ifmsh->bss = os_calloc(wpa_s->ifmsh->num_bss, - sizeof(struct hostapd_data *)); - if (!ifmsh->bss) -@@ -451,7 +519,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - - return 0; - out_free: -- wpa_supplicant_mesh_deinit(wpa_s); -+ wpa_supplicant_mesh_deinit(wpa_s, true); - return -ENOMEM; - } - -@@ -499,7 +567,7 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, - goto out; - } - -- wpa_supplicant_mesh_deinit(wpa_s); -+ wpa_supplicant_mesh_deinit(wpa_s, true); - - wpa_s->pairwise_cipher = WPA_CIPHER_NONE; - wpa_s->group_cipher = WPA_CIPHER_NONE; -@@ -588,7 +656,7 @@ int wpa_supplicant_leave_mesh(struct wpa_supplicant *wpa_s, bool need_deinit) - - /* Need to send peering close messages first */ - if (need_deinit) -- wpa_supplicant_mesh_deinit(wpa_s); -+ wpa_supplicant_mesh_deinit(wpa_s, true); - - ret = wpa_drv_leave_mesh(wpa_s); - if (ret) diff --git a/recipes-connectivity/hostapd/files/016-tests-DFS-test-for-wpa_supplicant-mesh.patch b/recipes-connectivity/hostapd/files/016-tests-DFS-test-for-wpa_supplicant-mesh.patch deleted file mode 100644 index ab18978..0000000 --- a/recipes-connectivity/hostapd/files/016-tests-DFS-test-for-wpa_supplicant-mesh.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 2347a0e409fb37bfe301dbc4de2a4a49ff8a9bdc Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:04 +0200 -Subject: [PATCH] tests: DFS test for wpa_supplicant mesh - -Add a test with uses a DFS channel, waits for CAC -afterwards successfull mesh join and then triggers -a radar event and check if the mesh comes up again -on the same device. - -Signed-off-by: Markus Theil - ---- - tests/hwsim/test_wpas_mesh.py | 56 +++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 54 insertions(+), 2 deletions(-) - -diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py -index bc07f5e25..0dcca03e0 100644 ---- a/tests/hwsim/test_wpas_mesh.py -+++ b/tests/hwsim/test_wpas_mesh.py -@@ -80,8 +80,23 @@ def check_mesh_scan(dev, params, other_started=False, beacon_int=0): - if '[MESH]' not in bss['flags']: - raise Exception("BSS output did not include MESH flag") - --def check_mesh_group_added(dev): -- ev = dev.wait_event(["MESH-GROUP-STARTED"]) -+def check_dfs_started(dev, timeout=10): -+ ev = dev.wait_event(["DFS-CAC-START"], timeout=timeout) -+ if ev is None: -+ raise Exception("Test exception: CAC did not start") -+ -+def check_dfs_finished(dev, timeout=70): -+ ev = dev.wait_event(["DFS-CAC-COMPLETED"], timeout=timeout) -+ if ev is None: -+ raise Exception("Test exception: CAC did not finish") -+ -+def check_mesh_radar_handling_finished(dev, timeout=75): -+ ev = dev.wait_event(["CTRL-EVENT-CHANNEL-SWITCH", "MESH-GROUP-STARTED"], timeout=timeout) -+ if ev is None: -+ raise Exception("Test exception: Couldn't join mesh") -+ -+def check_mesh_group_added(dev, timeout=10): -+ ev = dev.wait_event(["MESH-GROUP-STARTED"], timeout=timeout) - if ev is None: - raise Exception("Test exception: Couldn't join mesh") - -@@ -91,6 +106,10 @@ def check_mesh_group_removed(dev): - if ev is None: - raise Exception("Test exception: Couldn't leave mesh") - -+def check_regdom_change(dev, timeout=10): -+ ev = dev.wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=timeout) -+ if ev is None: -+ raise Exception("Test exception: No regdom change happened.") - - def check_mesh_peer_connected(dev, timeout=10): - ev = dev.wait_event(["MESH-PEER-CONNECTED"], timeout=timeout) -@@ -167,6 +186,39 @@ def test_wpas_mesh_group_remove(dev): - check_mesh_group_removed(dev[0]) - dev[0].mesh_group_remove() - -+def dfs_simulate_radar(dev): -+ logger.info("Trigger a simulated radar event") -+ phyname = dev.get_driver_status_field("phyname") -+ radar_file = '/sys/kernel/debug/ieee80211/' + phyname + '/hwsim/dfs_simulate_radar' -+ with open(radar_file, 'w') as f: -+ f.write('1') -+ -+@long_duration_test -+def test_wpas_mesh_peer_connected_dfs(dev): -+ """wpa_supplicant MESH peer connected""" -+ dev[0].set("country", "DE") -+ dev[1].set("country", "DE") -+ -+ check_regdom_change(dev[0]) -+ check_regdom_change(dev[1]) -+ -+ check_mesh_support(dev[0]) -+ add_open_mesh_network(dev[0], freq="5500", beacon_int=160) -+ add_open_mesh_network(dev[1], freq="5500", beacon_int=160) -+ check_dfs_started(dev[0]) -+ check_dfs_finished(dev[0]) -+ check_mesh_joined_connected(dev, timeout0=10) -+ -+ dfs_simulate_radar(dev[0]) -+ -+ check_mesh_radar_handling_finished(dev[0], timeout=75) -+ -+ dev[0].set("country", "00") -+ dev[1].set("country", "00") -+ -+ check_regdom_change(dev[0]) -+ check_regdom_change(dev[1]) -+ - def test_wpas_mesh_peer_connected(dev): - """wpa_supplicant MESH peer connected""" - check_mesh_support(dev[0]) diff --git a/recipes-connectivity/hostapd/files/017-mesh-fix-mesh_oom-test.patch b/recipes-connectivity/hostapd/files/017-mesh-fix-mesh_oom-test.patch deleted file mode 100644 index 485263f..0000000 --- a/recipes-connectivity/hostapd/files/017-mesh-fix-mesh_oom-test.patch +++ /dev/null @@ -1,27 +0,0 @@ -From a12ca1d46960736e0a15bc1b07cdfef08aab4b9e Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:05 +0200 -Subject: [PATCH] mesh: fix mesh_oom test - -Only change freq params, if ifmsh->freq is set initially, which only -happens if hostapd_get_hw_features in setup_interface2 succeeds. - -Signed-off-by: Markus Theil - ---- - wpa_supplicant/mesh.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 81abc5c40..f98e6b883 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -218,7 +218,7 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - * inspect if channel's been changed since initialized. - * i.e. DFS radar detection - */ -- if (ifmsh->freq != params->freq.freq) { -+ if (ifmsh->freq > 0 && ifmsh->freq != params->freq.freq) { - wpa_s->assoc_freq = ifmsh->freq; - ssid->frequency = ifmsh->freq; - struct he_capabilities *he_capab = NULL; diff --git a/recipes-connectivity/hostapd/files/018-mesh-move-mesh-freq-setting-to-own-function.patch b/recipes-connectivity/hostapd/files/018-mesh-move-mesh-freq-setting-to-own-function.patch deleted file mode 100644 index 3f95d19..0000000 --- a/recipes-connectivity/hostapd/files/018-mesh-move-mesh-freq-setting-to-own-function.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 2615253ba66cf55405b0a18f784d82f5993d71d0 Mon Sep 17 00:00:00 2001 -From: Markus Theil -Date: Tue, 30 Jun 2020 14:19:06 +0200 -Subject: [PATCH] mesh: move mesh freq setting to own function - -Signed-off-by: Markus Theil - ---- - wpa_supplicant/mesh.c | 59 +++++++++++++++++++++++++++++++-------------------- - 1 file changed, 36 insertions(+), 23 deletions(-) - -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index f98e6b883..f3788bf36 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -201,6 +201,40 @@ static int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s) - return !wpa_s->mesh_rsn ? -1 : 0; - } - -+ -+static int wpas_mesh_update_freq_params(struct wpa_supplicant *wpa_s) -+{ -+ struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params; -+ struct hostapd_iface *ifmsh = wpa_s->ifmsh; -+ struct he_capabilities *he_capab = NULL; -+ -+ if (ifmsh->current_mode) -+ he_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH]; -+ -+ if (hostapd_set_freq_params(¶ms->freq, -+ ifmsh->conf->hw_mode, -+ ifmsh->freq, -+ ifmsh->conf->channel, -+ ifmsh->conf->enable_edmg, -+ ifmsh->conf->edmg_channel, -+ ifmsh->conf->ieee80211n, -+ ifmsh->conf->ieee80211ac, -+ ifmsh->conf->ieee80211ax, -+ ifmsh->conf->secondary_channel, -+ hostapd_get_oper_chwidth(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf), -+ hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf), -+ ifmsh->conf->vht_capab, -+ he_capab)) { -+ wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); -+ wpa_supplicant_mesh_deinit(wpa_s, true); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+ - static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - { - struct hostapd_iface *ifmsh = wpa_s->ifmsh; -@@ -221,30 +255,8 @@ static int wpas_mesh_complete(struct wpa_supplicant *wpa_s) - if (ifmsh->freq > 0 && ifmsh->freq != params->freq.freq) { - wpa_s->assoc_freq = ifmsh->freq; - ssid->frequency = ifmsh->freq; -- struct he_capabilities *he_capab = NULL; -- -- if (ifmsh->current_mode) -- he_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH]; -- -- if (hostapd_set_freq_params(¶ms->freq, -- ifmsh->conf->hw_mode, -- ifmsh->freq, -- ifmsh->conf->channel, -- ifmsh->conf->enable_edmg, -- ifmsh->conf->edmg_channel, -- ifmsh->conf->ieee80211n, -- ifmsh->conf->ieee80211ac, -- ifmsh->conf->ieee80211ax, -- ifmsh->conf->secondary_channel, -- hostapd_get_oper_chwidth(ifmsh->conf), -- hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf), -- hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf), -- ifmsh->conf->vht_capab, -- he_capab)) { -- wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); -- wpa_supplicant_mesh_deinit(wpa_s, true); -+ if (wpas_mesh_update_freq_params(wpa_s) != 0) - return -1; -- } - } - - if (ifmsh->mconf->security != MESH_CONF_SEC_NONE && -@@ -518,6 +530,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, - } - - return 0; -+ - out_free: - wpa_supplicant_mesh_deinit(wpa_s, true); - return -ENOMEM; diff --git a/recipes-connectivity/hostapd/files/020-ignore-4addr-mode-enabling-error.patch b/recipes-connectivity/hostapd/files/020-ignore-4addr-mode-enabling-error.patch deleted file mode 100644 index 925a17a..0000000 --- a/recipes-connectivity/hostapd/files/020-ignore-4addr-mode-enabling-error.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 925c078d8f80fb387fcd5f05661e407c1935b4a8 Mon Sep 17 00:00:00 2001 -From: Jouni Malinen -Date: Sat, 13 Feb 2021 23:59:28 +0200 -Subject: [PATCH] nl80211: Ignore 4addr mode enabling error if it was already - enabled - -nl80211_set_4addr_mode() could fail when trying to enable 4addr mode on -an interface that is in a bridge and has 4addr mode already enabled. -This operation would not have been necessary in the first place and this -failure results in disconnecting, e.g., when roaming from one backhaul -BSS to another BSS with Multi AP. - -Avoid this issue by ignoring the nl80211 command failure in the case -where 4addr mode is being enabled while it has already been enabled. - -Signed-off-by: Jouni Malinen - ---- - src/drivers/driver_nl80211.c | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 3f691b21b..7101c9db6 100644 ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -617,6 +617,7 @@ struct wiphy_idx_data { - int wiphy_idx; - enum nl80211_iftype nlmode; - u8 *macaddr; -+ u8 use_4addr; - }; - - -@@ -639,6 +640,9 @@ static int netdev_info_handler(struct nl_msg *msg, void *arg) - os_memcpy(info->macaddr, nla_data(tb[NL80211_ATTR_MAC]), - ETH_ALEN); - -+ if (tb[NL80211_ATTR_4ADDR]) -+ info->use_4addr = nla_get_u8(tb[NL80211_ATTR_4ADDR]); -+ - return NL_SKIP; - } - -@@ -691,6 +695,20 @@ static int nl80211_get_macaddr(struct i802_bss *bss) - } - - -+static int nl80211_get_4addr(struct i802_bss *bss) -+{ -+ struct nl_msg *msg; -+ struct wiphy_idx_data data = { -+ .use_4addr = 0, -+ }; -+ -+ if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE)) || -+ send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data)) -+ return -1; -+ return data.use_4addr; -+} -+ -+ - static int nl80211_register_beacons(struct wpa_driver_nl80211_data *drv, - struct nl80211_wiphy_data *w) - { -@@ -11508,6 +11526,11 @@ static int nl80211_set_4addr_mode(void *priv, const char *bridge_ifname, - - ret = send_and_recv_msgs(drv, msg, NULL, NULL); - msg = NULL; -+ if (ret && val && nl80211_get_4addr(bss) == 1) { -+ wpa_printf(MSG_DEBUG, -+ "nl80211: 4addr mode was already enabled"); -+ ret = 0; -+ } - if (!ret) { - if (bridge_ifname[0] && val && - i802_check_bridge(drv, bss, bridge_ifname, bss->ifname) < 0) diff --git a/recipes-connectivity/hostapd/files/021-fix-sta-add-after-previous-connection.patch b/recipes-connectivity/hostapd/files/021-fix-sta-add-after-previous-connection.patch new file mode 100644 index 0000000..ac02ec5 --- /dev/null +++ b/recipes-connectivity/hostapd/files/021-fix-sta-add-after-previous-connection.patch @@ -0,0 +1,26 @@ +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -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. ++ * ++ * If the STA was associated and authorized earlier, but came for a new ++ * connection (!added_unassoc + !reassoc), remove the existing STA entry ++ * so that it can be re-added. This case is rarely seen when the AP could ++ * not receive the deauth/disassoc frame from the STA. And the STA comes ++ * back with new connection within a short period or before the inactive ++ * STA entry is removed from the list. + */ + 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)", +@@ -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) && +- !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)))) { ++ !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)) || ++ (!reassoc && (sta->flags & WLAN_STA_AUTHORIZED)))) { + hostapd_drv_sta_remove(hapd, sta->addr); + wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED); + set = 0; diff --git a/recipes-connectivity/hostapd/files/022-hostapd-fix-use-of-uninitialized-stack-variables.patch b/recipes-connectivity/hostapd/files/022-hostapd-fix-use-of-uninitialized-stack-variables.patch new file mode 100644 index 0000000..eb449c5 --- /dev/null +++ b/recipes-connectivity/hostapd/files/022-hostapd-fix-use-of-uninitialized-stack-variables.patch @@ -0,0 +1,31 @@ +From a035c0a0419a9936e043e90a8c6f66f2ab5f08b5 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Thu, 8 Jul 2021 16:33:03 +0200 +Subject: [PATCH] hostapd: fix use of uninitialized stack variables + +When a CSA is performed on an 80 MHz channel, hostapd_change_config_freq +unconditionally calls hostapd_set_oper_centr_freq_seg0/1_idx with seg0/1 +filled by ieee80211_freq_to_chan. +However, if ieee80211_freq_to_chan fails (because the freq is 0 or invalid), +seg0/1 remains uninitialized and filled with stack garbage, causing errors +such as "hostapd: 80 MHz: center segment 1 configured" + +Signed-off-by: Felix Fietkau + +--- + src/ap/hostapd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c +index f6fe8a8a0..2b07a9283 100644 +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -3453,7 +3453,7 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd, + struct hostapd_freq_params *old_params) + { + int channel; +- u8 seg0, seg1; ++ u8 seg0 = 0, seg1 = 0; + struct hostapd_hw_modes *mode; + + if (!params->channel) { diff --git a/recipes-connectivity/hostapd/files/023-ndisc_snoop-call-dl_list_del-before-freeing-ipv6-add.patch b/recipes-connectivity/hostapd/files/023-ndisc_snoop-call-dl_list_del-before-freeing-ipv6-add.patch new file mode 100644 index 0000000..709e378 --- /dev/null +++ b/recipes-connectivity/hostapd/files/023-ndisc_snoop-call-dl_list_del-before-freeing-ipv6-add.patch @@ -0,0 +1,25 @@ +From 97eb8d6e7a1b8fe424b9a0cae1985b6057324fe6 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Wed, 28 Jul 2021 05:43:29 +0200 +Subject: [PATCH] ndisc_snoop: call dl_list_del before freeing ipv6 addresses + +Fixes a segmentation fault on sta disconnect + +Signed-off-by: Felix Fietkau + +--- + src/ap/ndisc_snoop.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/ap/ndisc_snoop.c b/src/ap/ndisc_snoop.c +index 788c12fdc..bc1eb6251 100644 +--- a/src/ap/ndisc_snoop.c ++++ b/src/ap/ndisc_snoop.c +@@ -61,6 +61,7 @@ void sta_ip6addr_del(struct hostapd_data *hapd, struct sta_info *sta) + dl_list_for_each_safe(ip6addr, prev, &sta->ip6addr, struct ip6addr, + list) { + hostapd_drv_br_delete_ip_neigh(hapd, 6, (u8 *) &ip6addr->addr); ++ dl_list_del(&ip6addr->list); + os_free(ip6addr); + } + } diff --git a/recipes-connectivity/hostapd/files/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch b/recipes-connectivity/hostapd/files/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch new file mode 100644 index 0000000..44259e2 --- /dev/null +++ b/recipes-connectivity/hostapd/files/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch @@ -0,0 +1,281 @@ +From e5583c6d58d48ab01ee6fcd2086cb60448828cb8 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Wed, 28 Jul 2021 05:49:46 +0200 +Subject: [PATCH] driver_nl80211: rewrite neigh code to not depend on + libnl3-route + +Removes an unnecessary dependency and also makes the code smaller + +Signed-off-by: Felix Fietkau + +--- + src/drivers/driver_nl80211.c | 148 ++++++++++++++--------------------- + 1 file changed, 58 insertions(+), 90 deletions(-) + +diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c +index d62d685f4..de6a6c2f6 100644 +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -16,9 +16,6 @@ + #include + #include + #include +-#ifdef CONFIG_LIBNL3_ROUTE +-#include +-#endif /* CONFIG_LIBNL3_ROUTE */ + #include + #include + #include +@@ -5333,26 +5330,29 @@ fail: + + static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr) + { +-#ifdef CONFIG_LIBNL3_ROUTE + struct wpa_driver_nl80211_data *drv = bss->drv; +- struct rtnl_neigh *rn; +- struct nl_addr *nl_addr; ++ struct ndmsg nhdr = { ++ .ndm_state = NUD_PERMANENT, ++ .ndm_ifindex = bss->ifindex, ++ .ndm_family = AF_BRIDGE, ++ }; ++ struct nl_msg *msg; + int err; + +- rn = rtnl_neigh_alloc(); +- if (!rn) ++ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE); ++ if (!msg) + return; + +- rtnl_neigh_set_family(rn, AF_BRIDGE); +- rtnl_neigh_set_ifindex(rn, bss->ifindex); +- nl_addr = nl_addr_build(AF_BRIDGE, (void *) addr, ETH_ALEN); +- if (!nl_addr) { +- rtnl_neigh_put(rn); +- return; +- } +- rtnl_neigh_set_lladdr(rn, nl_addr); ++ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0) ++ goto errout; ++ ++ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr)) ++ goto errout; ++ ++ if (nl_send_auto_complete(drv->rtnl_sk, msg) < 0) ++ goto errout; + +- err = rtnl_neigh_delete(drv->rtnl_sk, rn, 0); ++ err = nl_wait_for_ack(drv->rtnl_sk); + if (err < 0) { + wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for " + MACSTR " ifindex=%d failed: %s", MAC2STR(addr), +@@ -5362,9 +5362,8 @@ static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr) + MACSTR, MAC2STR(addr)); + } + +- nl_addr_put(nl_addr); +- rtnl_neigh_put(rn); +-#endif /* CONFIG_LIBNL3_ROUTE */ ++errout: ++ nlmsg_free(msg); + } + + +@@ -7747,7 +7746,6 @@ static void *i802_init(struct hostapd_data *hapd, + (params->num_bridge == 0 || !params->bridge[0])) + add_ifidx(drv, br_ifindex, drv->ifindex); + +-#ifdef CONFIG_LIBNL3_ROUTE + if (bss->added_if_into_bridge || bss->already_in_bridge) { + int err; + +@@ -7764,7 +7762,6 @@ static void *i802_init(struct hostapd_data *hapd, + goto failed; + } + } +-#endif /* CONFIG_LIBNL3_ROUTE */ + + if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) { + wpa_printf(MSG_DEBUG, +@@ -10797,13 +10794,14 @@ static int wpa_driver_br_add_ip_neigh(void *priv, u8 version, + const u8 *ipaddr, int prefixlen, + const u8 *addr) + { +-#ifdef CONFIG_LIBNL3_ROUTE + struct i802_bss *bss = priv; + struct wpa_driver_nl80211_data *drv = bss->drv; +- struct rtnl_neigh *rn; +- struct nl_addr *nl_ipaddr = NULL; +- struct nl_addr *nl_lladdr = NULL; +- int family, addrsize; ++ struct ndmsg nhdr = { ++ .ndm_state = NUD_PERMANENT, ++ .ndm_ifindex = bss->br_ifindex, ++ }; ++ struct nl_msg *msg; ++ int addrsize; + int res; + + if (!ipaddr || prefixlen == 0 || !addr) +@@ -10822,85 +10820,66 @@ static int wpa_driver_br_add_ip_neigh(void *priv, u8 version, + } + + if (version == 4) { +- family = AF_INET; ++ nhdr.ndm_family = AF_INET; + addrsize = 4; + } else if (version == 6) { +- family = AF_INET6; ++ nhdr.ndm_family = AF_INET6; + addrsize = 16; + } else { + return -EINVAL; + } + +- rn = rtnl_neigh_alloc(); +- if (rn == NULL) ++ msg = nlmsg_alloc_simple(RTM_NEWNEIGH, NLM_F_CREATE); ++ if (!msg) + return -ENOMEM; + +- /* set the destination ip address for neigh */ +- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize); +- if (nl_ipaddr == NULL) { +- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed"); +- res = -ENOMEM; ++ res = -ENOMEM; ++ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0) + goto errout; +- } +- nl_addr_set_prefixlen(nl_ipaddr, prefixlen); +- res = rtnl_neigh_set_dst(rn, nl_ipaddr); +- if (res) { +- wpa_printf(MSG_DEBUG, +- "nl80211: neigh set destination addr failed"); ++ ++ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr)) + goto errout; +- } + +- /* set the corresponding lladdr for neigh */ +- nl_lladdr = nl_addr_build(AF_BRIDGE, (u8 *) addr, ETH_ALEN); +- if (nl_lladdr == NULL) { +- wpa_printf(MSG_DEBUG, "nl80211: neigh set lladdr failed"); +- res = -ENOMEM; ++ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr)) + goto errout; +- } +- rtnl_neigh_set_lladdr(rn, nl_lladdr); + +- rtnl_neigh_set_ifindex(rn, bss->br_ifindex); +- rtnl_neigh_set_state(rn, NUD_PERMANENT); ++ res = nl_send_auto_complete(drv->rtnl_sk, msg); ++ if (res < 0) ++ goto errout; + +- res = rtnl_neigh_add(drv->rtnl_sk, rn, NLM_F_CREATE); ++ res = nl_wait_for_ack(drv->rtnl_sk); + if (res) { + wpa_printf(MSG_DEBUG, + "nl80211: Adding bridge ip neigh failed: %s", + nl_geterror(res)); + } + errout: +- if (nl_lladdr) +- nl_addr_put(nl_lladdr); +- if (nl_ipaddr) +- nl_addr_put(nl_ipaddr); +- if (rn) +- rtnl_neigh_put(rn); ++ nlmsg_free(msg); + return res; +-#else /* CONFIG_LIBNL3_ROUTE */ +- return -1; +-#endif /* CONFIG_LIBNL3_ROUTE */ + } + + + static int wpa_driver_br_delete_ip_neigh(void *priv, u8 version, + const u8 *ipaddr) + { +-#ifdef CONFIG_LIBNL3_ROUTE + struct i802_bss *bss = priv; + struct wpa_driver_nl80211_data *drv = bss->drv; +- struct rtnl_neigh *rn; +- struct nl_addr *nl_ipaddr; +- int family, addrsize; ++ struct ndmsg nhdr = { ++ .ndm_state = NUD_PERMANENT, ++ .ndm_ifindex = bss->br_ifindex, ++ }; ++ struct nl_msg *msg; ++ int addrsize; + int res; + + if (!ipaddr) + return -EINVAL; + + if (version == 4) { +- family = AF_INET; ++ nhdr.ndm_family = AF_INET; + addrsize = 4; + } else if (version == 6) { +- family = AF_INET6; ++ nhdr.ndm_family = AF_INET6; + addrsize = 16; + } else { + return -EINVAL; +@@ -10918,41 +10897,30 @@ static int wpa_driver_br_delete_ip_neigh(void *priv, u8 version, + return -1; + } + +- rn = rtnl_neigh_alloc(); +- if (rn == NULL) ++ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE); ++ if (!msg) + return -ENOMEM; + +- /* set the destination ip address for neigh */ +- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize); +- if (nl_ipaddr == NULL) { +- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed"); +- res = -ENOMEM; ++ res = -ENOMEM; ++ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0) + goto errout; +- } +- res = rtnl_neigh_set_dst(rn, nl_ipaddr); +- if (res) { +- wpa_printf(MSG_DEBUG, +- "nl80211: neigh set destination addr failed"); ++ ++ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr)) + goto errout; +- } + +- rtnl_neigh_set_ifindex(rn, bss->br_ifindex); ++ res = nl_send_auto_complete(drv->rtnl_sk, msg); ++ if (res < 0) ++ goto errout; + +- res = rtnl_neigh_delete(drv->rtnl_sk, rn, 0); ++ res = nl_wait_for_ack(drv->rtnl_sk); + if (res) { + wpa_printf(MSG_DEBUG, + "nl80211: Deleting bridge ip neigh failed: %s", + nl_geterror(res)); + } + errout: +- if (nl_ipaddr) +- nl_addr_put(nl_ipaddr); +- if (rn) +- rtnl_neigh_put(rn); ++ nlmsg_free(msg); + return res; +-#else /* CONFIG_LIBNL3_ROUTE */ +- return -1; +-#endif /* CONFIG_LIBNL3_ROUTE */ + } + + diff --git a/recipes-connectivity/hostapd/files/040-mesh-allow-processing-authentication-frames-in-block.patch b/recipes-connectivity/hostapd/files/040-mesh-allow-processing-authentication-frames-in-block.patch new file mode 100644 index 0000000..55299af --- /dev/null +++ b/recipes-connectivity/hostapd/files/040-mesh-allow-processing-authentication-frames-in-block.patch @@ -0,0 +1,40 @@ +From 9450fcbac73a7f0eb1bcac4d7dd25d5d9309bb87 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Mon, 18 Feb 2019 12:57:11 +0100 +Subject: [PATCH] mesh: allow processing authentication frames in blocked state + +If authentication fails repeatedly e.g. because of a weak signal, the link +can end up in blocked state. If one of the nodes tries to establish a link +again before it is unblocked on the other side, it will block the link to +that other side. The same happens on the other side when it unblocks the +link. In that scenario, the link never recovers on its own. + +To fix this, allow restarting authentication even if the link is in blocked +state, but don't initiate the attempt until the blocked period is over. + +Signed-off-by: Felix Fietkau + +--- + src/ap/ieee802_11.c | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c +index e0d75498c..8f7e3de21 100644 +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -3775,15 +3775,6 @@ static void handle_auth(struct hostapd_data *hapd, + seq_ctrl); + return; + } +-#ifdef CONFIG_MESH +- if ((hapd->conf->mesh & MESH_ENABLED) && +- sta->plink_state == PLINK_BLOCKED) { +- wpa_printf(MSG_DEBUG, "Mesh peer " MACSTR +- " is blocked - drop Authentication frame", +- MAC2STR(mgmt->sa)); +- return; +- } +-#endif /* CONFIG_MESH */ + #ifdef CONFIG_PASN + if (auth_alg == WLAN_AUTH_PASN && + (sta->flags & WLAN_STA_ASSOC)) { diff --git a/recipes-connectivity/hostapd/files/050-build_fix.patch b/recipes-connectivity/hostapd/files/050-build_fix.patch new file mode 100644 index 0000000..b3096c0 --- /dev/null +++ b/recipes-connectivity/hostapd/files/050-build_fix.patch @@ -0,0 +1,33 @@ +From 15ddf28504bf656e6c8de16db69fd0cb9cbf7ae0 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:24 +0000 + +--- + hostapd/Makefile | 1 + + wpa_supplicant/Makefile | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/hostapd/Makefile b/hostapd/Makefile +index 73cf28c1a..4e79daa73 100644 +--- a/hostapd/Makefile ++++ b/hostapd/Makefile +@@ -324,6 +324,7 @@ ifdef CONFIG_FILS + CFLAGS += -DCONFIG_FILS + OBJS += ../src/ap/fils_hlp.o + NEED_SHA384=y ++NEED_HMAC_SHA384_KDF=y + NEED_AES_SIV=y + ifdef CONFIG_FILS_SK_PFS + CFLAGS += -DCONFIG_FILS_SK_PFS +diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile +index a6bcb4c42..707d6dc88 100644 +--- a/wpa_supplicant/Makefile ++++ b/wpa_supplicant/Makefile +@@ -320,6 +320,7 @@ endif + ifdef CONFIG_FILS + CFLAGS += -DCONFIG_FILS + NEED_SHA384=y ++NEED_HMAC_SHA384_KDF=y + NEED_AES_SIV=y + ifdef CONFIG_FILS_SK_PFS + CFLAGS += -DCONFIG_FILS_SK_PFS diff --git a/recipes-connectivity/hostapd/files/050-mesh-make-forwarding-configurable.patch b/recipes-connectivity/hostapd/files/050-mesh-make-forwarding-configurable.patch deleted file mode 100644 index e8053c5..0000000 --- a/recipes-connectivity/hostapd/files/050-mesh-make-forwarding-configurable.patch +++ /dev/null @@ -1,240 +0,0 @@ -From ec4f65913d8e4f439660243a7cccaaf632ea3a79 Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Wed, 18 Apr 2018 19:24:31 +0200 -Subject: [PATCH] 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(-) - -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 4c2e60095..745689b7d 100644 ---- 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]; - -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 49a580077..f4186211d 100644 ---- 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; - }; - -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 7101c9db6..77db47ca7 100644 ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -10041,6 +10041,9 @@ static int nl80211_put_mesh_config(struct nl_msg *msg, - 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)) || -diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index 58c53cdb3..3a8ae8ef6 100644 ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c -@@ -2473,6 +2473,7 @@ static const struct parse_data ssid_fields[] = { - #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(struct wpa_ssid *ssid) - 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_empty(const char *ctrl_interface, - 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 global_fields[] = { - { 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 }, -diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h -index 2d4cb1b8f..596a63b4b 100644 ---- 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 -diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c -index 1ca254813..ecebf508d 100644 ---- a/wpa_supplicant/config_file.c -+++ b/wpa_supplicant/config_file.c -@@ -866,6 +866,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid) - #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 *f, struct wpa_config *config) - 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", -diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h -index 2c08c0218..074576188 100644 ---- 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; - -diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index f3788bf36..278e4b585 100644 ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -137,6 +137,7 @@ static struct mesh_conf * mesh_config_create(struct wpa_supplicant *wpa_s, - 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(struct wpa_supplicant *wpa_s, - 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_supplicant *wpa_s, - } - 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)) { -diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c -index ea62abf5b..b0bfc6ba8 100644 ---- a/wpa_supplicant/mesh_mpm.c -+++ b/wpa_supplicant/mesh_mpm.c -@@ -303,9 +303,9 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_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); -diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf -index 125083414..4326af74b 100644 ---- 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/recipes-connectivity/hostapd/files/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch b/recipes-connectivity/hostapd/files/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch deleted file mode 100644 index 289431e..0000000 --- a/recipes-connectivity/hostapd/files/060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 4e71552d6cbd0109e8b21caf7ff5f807de5e5487 Mon Sep 17 00:00:00 2001 -From: Jouni Malinen -Date: Tue, 8 Dec 2020 23:52:50 +0200 -Subject: [PATCH] P2P: Fix a corner case in peer addition based on PD Request - -p2p_add_device() may remove the oldest entry if there is no room in the -peer table for a new peer. This would result in any pointer to that -removed entry becoming stale. A corner case with an invalid PD Request -frame could result in such a case ending up using (read+write) freed -memory. This could only by triggered when the peer table has reached its -maximum size and the PD Request frame is received from the P2P Device -Address of the oldest remaining entry and the frame has incorrect P2P -Device Address in the payload. - -Fix this by fetching the dev pointer again after having called -p2p_add_device() so that the stale pointer cannot be used. - -Fixes: 17bef1e97a50 ("P2P: Add peer entry based on Provision Discovery Request") -Signed-off-by: Jouni Malinen - ---- - src/p2p/p2p_pd.c | 12 +++++------- - 1 file changed, 5 insertions(+), 7 deletions(-) - -diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c -index 3994ec03f..05fd59349 100644 ---- a/src/p2p/p2p_pd.c -+++ b/src/p2p/p2p_pd.c -@@ -595,14 +595,12 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa, - goto out; - } - -+ dev = p2p_get_device(p2p, sa); - if (!dev) { -- dev = p2p_get_device(p2p, sa); -- if (!dev) { -- p2p_dbg(p2p, -- "Provision Discovery device not found " -- MACSTR, MAC2STR(sa)); -- goto out; -- } -+ p2p_dbg(p2p, -+ "Provision Discovery device not found " -+ MACSTR, MAC2STR(sa)); -+ goto out; - } - } else if (msg.wfd_subelems) { - wpabuf_free(dev->info.wfd_subelems); diff --git a/recipes-connectivity/hostapd/files/100-daemonize_fix.patch b/recipes-connectivity/hostapd/files/100-daemonize_fix.patch index e7864b6..fc0b8a7 100644 --- a/recipes-connectivity/hostapd/files/100-daemonize_fix.patch +++ b/recipes-connectivity/hostapd/files/100-daemonize_fix.patch @@ -1,13 +1,13 @@ -From 6f63b0f6359f63a733da2baac2b920337f3e7d78 Mon Sep 17 00:00:00 2001 +From ec89cf6113ab9324e0095b8ea64eb93a3ff98b11 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 --- - src/utils/os_unix.c | 68 ++++++++++++++++++++++------------------------------- + src/utils/os_unix.c | 68 +++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c -index 6f0c17756..1376416c3 100644 +index 258deef9d..5b026f8f6 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -10,6 +10,7 @@ diff --git a/recipes-connectivity/hostapd/files/110-notify-mgmt-frames.patch b/recipes-connectivity/hostapd/files/110-notify-mgmt-frames.patch deleted file mode 100644 index 4639207..0000000 --- a/recipes-connectivity/hostapd/files/110-notify-mgmt-frames.patch +++ /dev/null @@ -1,127 +0,0 @@ -From de6a3ac0846f213f1aab60774d350808e71aa210 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= -Date: Thu, 26 Nov 2020 09:27:40 +0100 -Subject: [PATCH] hostapd: Add an option to notify management frames on - ctrl_iface -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In some contexts (e.g. Multi-AP) it can be useful to have access to -some of the management frames in upper layers (e.g. to be able to -process the content of association requests externally). - -Add 'notify_mgmt_frames'. When enabled, it will notify the ctrl_iface -when a management frame arrives using 'AP_MGMT_FRAME_RECEIVED'. - -Note that to avoid completely flooding the ctrl_iface, not all -management frames are included (e.g. beacons are excluded). - -Signed-off-by: Raphaël Mélotte - ---- - hostapd/config_file.c | 2 ++ - hostapd/hostapd.conf | 4 ++++ - src/ap/ap_config.h | 2 ++ - src/ap/ieee802_11.c | 25 +++++++++++++++++++++++++ - src/common/wpa_ctrl.h | 3 +++ - 5 files changed, 36 insertions(+) - -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index dac0e8054..42d01825c 100644 ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -4456,6 +4456,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, - bss->multicast_to_unicast = atoi(pos); - } else if (os_strcmp(buf, "broadcast_deauth") == 0) { - bss->broadcast_deauth = atoi(pos); -+ } else if (os_strcmp(buf, "notify_mgmt_frames") == 0) { -+ conf->notify_mgmt_frames = atoi(pos); - #ifdef CONFIG_DPP - } else if (os_strcmp(buf, "dpp_name") == 0) { - os_free(bss->dpp_name); -diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf -index 2b0f762e5..e31885545 100644 ---- a/hostapd/hostapd.conf -+++ b/hostapd/hostapd.conf -@@ -571,6 +571,10 @@ wmm_ac_vo_acm=0 - # Default: 1 (enabled) - #broadcast_deauth=1 - -+# Get notifications for management frames: -+# Default: 0 (disabled) -+#notify_mgmt_frames=0 -+ - ##### IEEE 802.11n related configuration ###################################### - - # ieee80211n: Whether IEEE 802.11n (HT) is enabled -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 745689b7d..5dc6caf24 100644 ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -1060,6 +1060,8 @@ struct hostapd_config { - unsigned int airtime_update_interval; - #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1) - #endif /* CONFIG_AIRTIME_POLICY */ -+ -+ u8 notify_mgmt_frames; - }; - - -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 8b994d6a5..7346c6f0c 100644 ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -4878,6 +4878,28 @@ static int handle_action(struct hostapd_data *hapd, - return 1; - } - -+/** -+ * notify_mgmt_frame - notify of management frames on the control interface. -+ * @hapd: hostapd BSS data structure (the BSS to which the management frame was -+ * sent to) -+ * @buf: management frame data (starting from IEEE 802.11 header) -+ * @len: length of frame data in octets -+ * -+ * Notify the control interface of any management frame. -+ */ -+static void notify_mgmt_frame(struct hostapd_data *hapd, const u8 *buf, -+ size_t len) -+{ -+ -+ int hex_len = len * 2 + 1; -+ char *hex = os_malloc(hex_len); -+ -+ if (hex) { -+ wpa_snprintf_hex(hex, hex_len, buf, len); -+ wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, AP_MGMT_FRAME_RECEIVED "buf=%s", hex); -+ os_free(hex); -+ } -+} - - /** - * ieee802_11_mgmt - process incoming IEEE 802.11 management frames -@@ -4969,6 +4991,9 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, - if (hapd->iconf->track_sta_max_num) - sta_track_add(hapd->iface, mgmt->sa, ssi_signal); - -+ if (hapd->iconf->notify_mgmt_frames) -+ notify_mgmt_frame(hapd, buf, len); -+ - switch (stype) { - case WLAN_FC_STYPE_AUTH: - wpa_printf(MSG_DEBUG, "mgmt::auth"); -diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h -index 488e4addc..3cdacc72d 100644 ---- a/src/common/wpa_ctrl.h -+++ b/src/common/wpa_ctrl.h -@@ -396,6 +396,9 @@ extern "C" { - #define BIT(x) (1U << (x)) - #endif - -+/* Event triggered for received management frame */ -+#define AP_MGMT_FRAME_RECEIVED "AP-MGMT-FRAME-RECEIVED " -+ - /* BSS command information masks */ - - #define WPA_BSS_MASK_ALL 0xFFFDFFFF diff --git a/recipes-connectivity/hostapd/files/110-wolfssl-compile-fix.patch b/recipes-connectivity/hostapd/files/110-wolfssl-compile-fix.patch deleted file mode 100644 index efebefd..0000000 --- a/recipes-connectivity/hostapd/files/110-wolfssl-compile-fix.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 345b72c78078996f326c0a5b2a96c5d14b18945b Mon Sep 17 00:00:00 2001 -From: OpenEmbedded -Date: Tue, 23 Mar 2021 15:10:37 +0000 - ---- - src/crypto/tls_wolfssl.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/crypto/tls_wolfssl.c b/src/crypto/tls_wolfssl.c -index 11e658220..bd0f4a5ac 100644 ---- a/src/crypto/tls_wolfssl.c -+++ b/src/crypto/tls_wolfssl.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - - #if defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || defined(EAP_SERVER_FAST) - #define HAVE_AESGCM diff --git a/recipes-connectivity/hostapd/files/120-reconfigure-wps-credentials.patch b/recipes-connectivity/hostapd/files/120-reconfigure-wps-credentials.patch deleted file mode 100644 index 1572c13..0000000 --- a/recipes-connectivity/hostapd/files/120-reconfigure-wps-credentials.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 54f01438360f2fe735801eefa4519461b63aefd3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= -Date: Wed, 9 Dec 2020 19:55:53 +0100 -Subject: [PATCH] wps: reconfigure credentials on reload -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When new credentials are configured and hostapd is reconfigured using -SIGHUP (or reload on the ctrl_iface), also update the wps credentials. - -Before these changes, when WPS is triggered the registar always serves -the credentials that were configured when hostapd started. - -Signed-off-by: Raphaël Mélotte - ---- - src/ap/wps_hostapd.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++-- - src/wps/wps.h | 6 ++++ - src/wps/wps_registrar.c | 29 +++++++++++++++++ - 3 files changed, 118 insertions(+), 3 deletions(-) - -diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c -index dc8aa8f65..ff942a67b 100644 ---- a/src/ap/wps_hostapd.c -+++ b/src/ap/wps_hostapd.c -@@ -1375,6 +1375,43 @@ static void hostapd_wps_nfc_clear(struct wps_context *wps) - #endif /* CONFIG_WPS_NFC */ - } - -+int hostapd_wps_update_multi_ap(struct hostapd_data *hapd, -+ struct wps_registrar *reg) { -+ struct hostapd_bss_config *conf = hapd->conf; -+ u8 *multi_ap_backhaul_network_key = NULL; -+ size_t multi_ap_backhaul_network_key_len = 0; -+ int ret = -1; -+ -+ if ((conf->multi_ap & FRONTHAUL_BSS) && -+ conf->multi_ap_backhaul_ssid.ssid_len) { -+ if (conf->multi_ap_backhaul_ssid.wpa_passphrase) { -+ multi_ap_backhaul_network_key = -+ (u8 *) os_strdup(conf->multi_ap_backhaul_ssid.wpa_passphrase); -+ if (multi_ap_backhaul_network_key == NULL) -+ return -1; -+ multi_ap_backhaul_network_key_len = -+ os_strlen(conf->multi_ap_backhaul_ssid.wpa_passphrase); -+ } else if (conf->multi_ap_backhaul_ssid.wpa_psk) { -+ multi_ap_backhaul_network_key = os_malloc(2 * PMK_LEN + 1); -+ if (multi_ap_backhaul_network_key == NULL) -+ return -1; -+ wpa_snprintf_hex((char *) multi_ap_backhaul_network_key, -+ 2 * PMK_LEN + 1, -+ conf->multi_ap_backhaul_ssid.wpa_psk->psk, -+ PMK_LEN); -+ multi_ap_backhaul_network_key_len = 2 * PMK_LEN; -+ } -+ ret = wps_registrar_update_multi_ap(reg, -+ conf->multi_ap_backhaul_ssid.ssid, -+ conf->multi_ap_backhaul_ssid.ssid_len, -+ multi_ap_backhaul_network_key, -+ multi_ap_backhaul_network_key_len); -+ os_free(multi_ap_backhaul_network_key); -+ } -+ return ret; -+} -+ -+ - - void hostapd_deinit_wps(struct hostapd_data *hapd) - { -@@ -1409,11 +1446,54 @@ void hostapd_update_wps(struct hostapd_data *hapd) - hapd->wps->upc = hapd->conf->upc; - #endif /* CONFIG_WPS_UPNP */ - -- hostapd_wps_set_vendor_ext(hapd, hapd->wps); -- hostapd_wps_set_application_ext(hapd, hapd->wps); -+ struct wps_context *wps = hapd->wps; -+ struct hostapd_bss_config *conf = hapd->conf; -+ -+ os_memcpy(wps->ssid, conf->ssid.ssid, conf->ssid.ssid_len); -+ wps->ssid_len = conf->ssid.ssid_len; -+ -+ /* Clear wps settings, then fill them again */ -+ os_free(wps->network_key); -+ wps->network_key = NULL; -+ wps->network_key_len = 0; -+ wps->psk_set = 0; -+ if (conf->ssid.wpa_psk_file) { -+ /* Use per-device PSKs */ -+ } else if (conf->ssid.wpa_passphrase) { -+ wps->network_key = (u8 *) os_strdup(conf->ssid.wpa_passphrase); -+ if (wps->network_key == NULL) -+ return; -+ wps->network_key_len = os_strlen(conf->ssid.wpa_passphrase); -+ } else if (conf->ssid.wpa_psk) { -+ wps->network_key = os_malloc(2 * PMK_LEN + 1); -+ if (wps->network_key == NULL) -+ return; -+ wpa_snprintf_hex((char *) wps->network_key, 2 * PMK_LEN + 1, -+ conf->ssid.wpa_psk->psk, PMK_LEN); -+ wps->network_key_len = 2 * PMK_LEN; -+#ifdef CONFIG_WEP -+ } else if (conf->ssid.wep.keys_set && conf->ssid.wep.key[0]) { -+ wps->network_key = os_malloc(conf->ssid.wep.len[0]); -+ if (wps->network_key == NULL) -+ return; -+ os_memcpy(wps->network_key, conf->ssid.wep.key[0], -+ conf->ssid.wep.len[0]); -+ wps->network_key_len = conf->ssid.wep.len[0]; -+#endif /* CONFIG_WEP */ -+ } -+ -+ if (conf->ssid.wpa_psk) { -+ os_memcpy(wps->psk, conf->ssid.wpa_psk->psk, PMK_LEN); -+ wps->psk_set = 1; -+ } -+ -+ hostapd_wps_update_multi_ap(hapd, wps->registrar); -+ -+ hostapd_wps_set_vendor_ext(hapd, wps); -+ hostapd_wps_set_application_ext(hapd, wps); - - if (hapd->conf->wps_state) -- wps_registrar_update_ie(hapd->wps->registrar); -+ wps_registrar_update_ie(wps->registrar); - else - hostapd_deinit_wps(hapd); - } -diff --git a/src/wps/wps.h b/src/wps/wps.h -index 93888b011..110e3ea52 100644 ---- a/src/wps/wps.h -+++ b/src/wps/wps.h -@@ -938,6 +938,12 @@ struct wpabuf * wps_build_nfc_handover_sel_p2p(struct wps_context *ctx, - struct wpabuf *nfc_dh_pubkey, - struct wpabuf *nfc_dev_pw); - -+int wps_registrar_update_multi_ap(struct wps_registrar *reg, -+ const u8 *multi_ap_backhaul_ssid, -+ size_t multi_ap_backhaul_ssid_len, -+ const u8 *multi_ap_backhaul_network_key, -+ size_t multi_ap_backhaul_network_key_len); -+ - /* ndef.c */ - struct wpabuf * ndef_parse_wifi(const struct wpabuf *buf); - struct wpabuf * ndef_build_wifi(const struct wpabuf *buf); -diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c -index 9e1ee36da..d6b27be28 100644 ---- a/src/wps/wps_registrar.c -+++ b/src/wps/wps_registrar.c -@@ -3669,6 +3669,35 @@ int wps_registrar_config_ap(struct wps_registrar *reg, - } - - -+int wps_registrar_update_multi_ap(struct wps_registrar *reg, -+ const u8 *multi_ap_backhaul_ssid, -+ size_t multi_ap_backhaul_ssid_len, -+ const u8 *multi_ap_backhaul_network_key, -+ size_t multi_ap_backhaul_network_key_len) -+{ -+ if (multi_ap_backhaul_ssid != NULL) { -+ os_memcpy(reg->multi_ap_backhaul_ssid, -+ multi_ap_backhaul_ssid, -+ multi_ap_backhaul_ssid_len); -+ reg->multi_ap_backhaul_ssid_len = -+ multi_ap_backhaul_ssid_len; -+ } -+ os_free(reg->multi_ap_backhaul_network_key); -+ reg->multi_ap_backhaul_network_key = NULL; -+ reg->multi_ap_backhaul_network_key_len = 0; -+ -+ if (multi_ap_backhaul_network_key != NULL) { -+ reg->multi_ap_backhaul_network_key = -+ os_memdup(multi_ap_backhaul_network_key, -+ multi_ap_backhaul_network_key_len); -+ if (reg->multi_ap_backhaul_network_key == NULL) -+ return -1; -+ reg->multi_ap_backhaul_network_key_len = -+ multi_ap_backhaul_network_key_len; -+ } -+ return 0; -+} -+ - #ifdef CONFIG_WPS_NFC - - int wps_registrar_add_nfc_pw_token(struct wps_registrar *reg, diff --git a/recipes-connectivity/hostapd/files/200-multicall.patch b/recipes-connectivity/hostapd/files/200-multicall.patch index 80f2e2d..30f046b 100644 --- a/recipes-connectivity/hostapd/files/200-multicall.patch +++ b/recipes-connectivity/hostapd/files/200-multicall.patch @@ -1,4 +1,4 @@ -From 2ed1d7803b1be7691153a0a0710655eeb307ed75 Mon Sep 17 00:00:00 2001 +From c3efbfb27f3797b84e861a01f3e4f0dadc21966d Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -16,18 +16,18 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 10 files changed, 94 insertions(+), 17 deletions(-) diff --git a/hostapd/Makefile b/hostapd/Makefile -index 1400002a9..dae9cd119 100644 +index 4e79daa73..6c34c5f88 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -31,6 +31,7 @@ CFLAGS += -I$(abspath ../src/utils) - export BINDIR ?= /usr/local/bin/ +@@ -1,6 +1,7 @@ + ALL=hostapd hostapd_cli + CONFIG_FILE = .config - -include .config +-include $(if $(MULTICALL), ../wpa_supplicant/.config) + include ../src/build.rules - ifndef CONFIG_NO_GITVER - # Add VERSION_STR postfix for builds from a git repository -@@ -204,7 +205,8 @@ endif + ifdef LIBS +@@ -199,7 +200,8 @@ endif ifdef CONFIG_NO_VLAN CFLAGS += -DCONFIG_NO_VLAN @@ -37,7 +37,7 @@ index 1400002a9..dae9cd119 100644 OBJS += ../src/ap/vlan_init.o OBJS += ../src/ap/vlan_ifconfig.o OBJS += ../src/ap/vlan.o -@@ -354,10 +356,14 @@ CFLAGS += -DCONFIG_MBO +@@ -357,10 +359,14 @@ CFLAGS += -DCONFIG_MBO OBJS += ../src/ap/mbo_ap.o endif @@ -55,9 +55,9 @@ index 1400002a9..dae9cd119 100644 LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -1311,6 +1317,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL)) - - BCHECK=../src/drivers/build.hostapd +@@ -1291,6 +1297,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL)) + _OBJS_VAR := OBJS + include ../src/objs.mk +hostapd_multi.a: $(BCHECK) $(OBJS) + $(Q)$(CC) -c -o hostapd_multi.o -Dmain=hostapd_main $(CFLAGS) main.c @@ -65,12 +65,12 @@ index 1400002a9..dae9cd119 100644 + @rm -f $@ + @$(AR) cr $@ hostapd_multi.o $(OBJS) + - hostapd: $(BCHECK) $(OBJS) + hostapd: $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -1374,6 +1386,12 @@ SOBJS += ../src/crypto/sha256-kdf.o - SOBJS += ../src/crypto/sha384-kdf.o - SOBJS += ../src/crypto/sha512-kdf.o +@@ -1365,6 +1377,12 @@ include ../src/objs.mk + _OBJS_VAR := SOBJS + include ../src/objs.mk +dump_cflags: + @printf "%s " "$(CFLAGS)" @@ -82,10 +82,10 @@ index 1400002a9..dae9cd119 100644 $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n) @$(E) " LD " $@ diff --git a/hostapd/main.c b/hostapd/main.c -index 353b20a80..2bebdfe86 100644 +index 21932d1be..6a7b91bf2 100644 --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -590,6 +590,11 @@ fail: +@@ -591,6 +591,11 @@ fail: return -1; } @@ -104,13 +104,13 @@ index 353b20a80..2bebdfe86 100644 + wpa_supplicant_event = hostapd_wpa_event; + wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { - c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); + c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q"); if (c < 0) diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c -index 36678e7a3..52ac8f5a0 100644 +index fff8bb3e5..4d70939ef 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1789,8 +1789,8 @@ err: +@@ -1855,8 +1855,8 @@ err: #endif /* CONFIG_OWE */ @@ -121,7 +121,7 @@ index 36678e7a3..52ac8f5a0 100644 { struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -2035,7 +2035,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, +@@ -2128,7 +2128,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, } @@ -131,10 +131,10 @@ index 36678e7a3..52ac8f5a0 100644 { struct hapd_interfaces *interfaces = ctx; diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index f4186211d..9f5ded44e 100644 +index f069b74e1..f8f91c023 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5886,8 +5886,8 @@ union wpa_event_data { +@@ -6168,8 +6168,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -145,7 +145,7 @@ index f4186211d..9f5ded44e 100644 /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -5899,7 +5899,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, +@@ -6181,7 +6181,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -170,18 +170,18 @@ index e95df6ddb..9071da3cf 100644 const struct wpa_driver_ops *const wpa_drivers[] = { diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile -index 09ac7a493..d5caf23a3 100644 +index 707d6dc88..f7740e6f0 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -27,6 +27,7 @@ CFLAGS += -I$(abspath ../src) - CFLAGS += -I$(abspath ../src/utils) +@@ -10,6 +10,7 @@ ALL += dbus/fi.w1.wpa_supplicant1.service + EXTRA_TARGETS=dynamic_eap_methods - -include .config + CONFIG_FILE=.config +-include $(if $(MULTICALL),../hostapd/.config) + include ../src/build.rules - ifndef CONFIG_NO_GITVER - # Add VERSION_STR postfix for builds from a git repository -@@ -369,7 +370,9 @@ endif + ifdef CONFIG_BUILD_WPA_CLIENT_SO +@@ -371,7 +372,9 @@ endif ifdef CONFIG_IBSS_RSN NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_IBSS_RSN @@ -191,7 +191,7 @@ index 09ac7a493..d5caf23a3 100644 OBJS += ibss_rsn.o endif -@@ -890,6 +893,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -912,6 +915,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -202,7 +202,7 @@ index 09ac7a493..d5caf23a3 100644 endif ifdef CONFIG_AP -@@ -897,9 +904,11 @@ NEED_EAP_COMMON=y +@@ -919,9 +926,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -214,7 +214,7 @@ index 09ac7a493..d5caf23a3 100644 OBJS += ../src/ap/hostapd.o OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -979,6 +988,12 @@ endif +@@ -1008,6 +1017,12 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -227,7 +227,7 @@ index 09ac7a493..d5caf23a3 100644 endif ifdef CONFIG_MBO -@@ -987,7 +1002,9 @@ CFLAGS += -DCONFIG_MBO +@@ -1016,7 +1031,9 @@ CFLAGS += -DCONFIG_MBO endif ifdef NEED_RSN_AUTHENTICATOR @@ -237,10 +237,10 @@ index 09ac7a493..d5caf23a3 100644 NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1897,6 +1914,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) - - $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config +@@ -1920,6 +1937,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) + _OBJS_VAR := OBJS + include ../src/objs.mk +wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs) + $(Q)$(CC) -c -o wpa_supplicant_multi.o -Dmain=wpa_supplicant_main $(CFLAGS) main.c + @$(E) " CC " $< @@ -250,7 +250,7 @@ index 09ac7a493..d5caf23a3 100644 wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -1997,6 +2020,12 @@ endif +@@ -2052,6 +2075,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ @$(E) " sed" $< @@ -264,10 +264,10 @@ index 09ac7a493..d5caf23a3 100644 mv -f $< $@ wpa_cli.exe: wpa_cli diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c -index 9f69736b7..0284cbf61 100644 +index efec31c65..ca6faacf2 100644 --- a/wpa_supplicant/eapol_test.c +++ b/wpa_supplicant/eapol_test.c -@@ -30,7 +30,12 @@ +@@ -31,7 +31,12 @@ #include "ctrl_iface.h" #include "pcsc_funcs.h" #include "wpas_glue.h" @@ -280,7 +280,7 @@ index 9f69736b7..0284cbf61 100644 const struct wpa_driver_ops *const wpa_drivers[] = { NULL }; -@@ -1292,6 +1297,10 @@ static void usage(void) +@@ -1303,6 +1308,10 @@ static void usage(void) "option several times.\n"); } @@ -291,7 +291,7 @@ index 9f69736b7..0284cbf61 100644 int main(int argc, char *argv[]) { -@@ -1312,6 +1321,8 @@ int main(int argc, char *argv[]) +@@ -1323,6 +1332,8 @@ int main(int argc, char *argv[]) if (os_program_init()) return -1; @@ -301,10 +301,10 @@ index 9f69736b7..0284cbf61 100644 os_memset(&eapol_test, 0, sizeof(eapol_test)); diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c -index 86eef1b81..af91bae4e 100644 +index ec56cfdc0..48aa792b3 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4579,8 +4579,8 @@ static void wpas_event_unprot_beacon(struct wpa_supplicant *wpa_s, +@@ -4953,8 +4953,8 @@ static void wpas_event_unprot_beacon(struct wpa_supplicant *wpa_s, } @@ -315,7 +315,7 @@ index 86eef1b81..af91bae4e 100644 { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -5398,7 +5398,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, +@@ -5813,7 +5813,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, } @@ -325,7 +325,7 @@ index 86eef1b81..af91bae4e 100644 { struct wpa_supplicant *wpa_s; diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c -index c5d716869..63fc87332 100644 +index ff1fb6702..731325929 100644 --- a/wpa_supplicant/wpa_priv.c +++ b/wpa_supplicant/wpa_priv.c @@ -1038,8 +1038,8 @@ static void wpa_priv_send_ft_response(struct wpa_priv_interface *iface, @@ -348,7 +348,7 @@ index c5d716869..63fc87332 100644 union wpa_event_data *data) { struct wpa_priv_global *global = ctx; -@@ -1215,6 +1215,8 @@ int main(int argc, char *argv[]) +@@ -1216,6 +1216,8 @@ int main(int argc, char *argv[]) if (os_program_init()) return -1; @@ -358,10 +358,10 @@ index c5d716869..63fc87332 100644 os_memset(&global, 0, sizeof(global)); diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index 91ad7819b..a470b62e4 100644 +index fb47942c9..b00a24792 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -6594,7 +6594,6 @@ struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global, +@@ -7073,7 +7073,6 @@ struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global, return NULL; } @@ -369,7 +369,7 @@ index 91ad7819b..a470b62e4 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(struct wpa_global *global) +@@ -7108,6 +7107,11 @@ static int wpa_supplicant_match_existing(struct wpa_global *global) #endif /* CONFIG_MATCH_IFACE */ @@ -381,7 +381,7 @@ index 91ad7819b..a470b62e4 100644 /** * wpa_supplicant_add_iface - Add a new network interface -@@ -6887,6 +6891,8 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params) +@@ -7364,6 +7368,8 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params) #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ diff --git a/recipes-connectivity/hostapd/files/300-noscan.patch b/recipes-connectivity/hostapd/files/300-noscan.patch index a979fd4..5443fc7 100644 --- a/recipes-connectivity/hostapd/files/300-noscan.patch +++ b/recipes-connectivity/hostapd/files/300-noscan.patch @@ -1,4 +1,4 @@ -From 45937c19978783a74fc629465ff710a2821413bd Mon Sep 17 00:00:00 2001 +From 1a55572f699610d356997da020bcfb65da6d2dc5 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -10,10 +10,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 42d01825c..ce0c62152 100644 +index 8a86ce08b..03b902076 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3493,6 +3493,10 @@ static int hostapd_config_fill(struct hostapd_config *conf, +@@ -3435,6 +3435,10 @@ static int hostapd_config_fill(struct hostapd_config *conf, if (bss->ocv && !bss->ieee80211w) bss->ieee80211w = 1; #endif /* CONFIG_OCV */ @@ -25,10 +25,10 @@ index 42d01825c..ce0c62152 100644 conf->ieee80211n = atoi(pos); } else if (os_strcmp(buf, "ht_capab") == 0) { diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 5dc6caf24..319e8c108 100644 +index 805ea93df..58dd2cfed 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -984,6 +984,8 @@ struct hostapd_config { +@@ -1040,6 +1040,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; @@ -38,10 +38,10 @@ index 5dc6caf24..319e8c108 100644 int secondary_channel; int no_pri_sec_switch; diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c -index f6e69030d..63bd11db3 100644 +index 4b66b02f4..2b66ab563 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -500,7 +500,8 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface) +@@ -517,7 +517,8 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface) int ret; /* Check that HT40 is used and PRI / SEC switch is allowed */ diff --git a/recipes-connectivity/hostapd/files/301-mesh-noscan.patch b/recipes-connectivity/hostapd/files/301-mesh-noscan.patch index 0fe6d48..fc81478 100644 --- a/recipes-connectivity/hostapd/files/301-mesh-noscan.patch +++ b/recipes-connectivity/hostapd/files/301-mesh-noscan.patch @@ -1,4 +1,4 @@ -From 59042778abdb2eddffbf69268efb2dbef8f78f74 Mon Sep 17 00:00:00 2001 +From 0c333b13dfbf5a04e94cda26948e5dc48803e723 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -11,10 +11,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index 3a8ae8ef6..61a5e1c60 100644 +index bfbc46000..ec8301ab9 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2478,6 +2478,7 @@ static const struct parse_data ssid_fields[] = { +@@ -2531,6 +2531,7 @@ static const struct parse_data ssid_fields[] = { #else /* CONFIG_MESH */ { INT_RANGE(mode, 0, 4) }, #endif /* CONFIG_MESH */ @@ -23,10 +23,10 @@ index 3a8ae8ef6..61a5e1c60 100644 { INT_RANGE(disabled, 0, 2) }, { STR(id_str) }, diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c -index ecebf508d..c271cea9f 100644 +index c0763253f..93fc014e4 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -866,6 +866,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid) +@@ -766,6 +766,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid) #endif /* IEEE8021X_EAPOL */ INT(mode); INT(no_auto_peer); @@ -35,10 +35,10 @@ index ecebf508d..c271cea9f 100644 INT(frequency); INT(enable_edmg); diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h -index 074576188..2e205c08a 100644 +index 9b17c3b14..d5c90122a 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h -@@ -971,6 +971,8 @@ struct wpa_ssid { +@@ -981,6 +981,8 @@ struct wpa_ssid { */ int no_auto_peer; @@ -48,10 +48,10 @@ index 074576188..2e205c08a 100644 * mesh_rssi_threshold - Set mesh parameter mesh_rssi_threshold (dBm) * diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index 278e4b585..e46435c66 100644 +index b67396d5a..ad067da67 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -467,6 +467,8 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, +@@ -506,6 +506,8 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, frequency); goto out_free; } @@ -61,17 +61,20 @@ index 278e4b585..e46435c66 100644 if (ssid->mesh_basic_rates == NULL) { /* diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index a470b62e4..b5b7e2874 100644 +index b00a24792..bc2d4012d 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2334,12 +2334,12 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, +@@ -2452,7 +2452,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode); enum hostapd_hw_mode hw_mode; struct hostapd_hw_modes *mode = NULL; - 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, +@@ -2460,7 +2460,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, + 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; @@ -79,7 +82,7 @@ index a470b62e4..b5b7e2874 100644 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_supplicant *wpa_s, +@@ -2551,7 +2551,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, #endif /* CONFIG_HE_OVERRIDES */ /* Setup higher BW only for 5 GHz */ diff --git a/recipes-connectivity/hostapd/files/310-rescan_immediately.patch b/recipes-connectivity/hostapd/files/310-rescan_immediately.patch index 1aca3ca..566f08b 100644 --- a/recipes-connectivity/hostapd/files/310-rescan_immediately.patch +++ b/recipes-connectivity/hostapd/files/310-rescan_immediately.patch @@ -1,4 +1,4 @@ -From 62c26c79f50999302fbbd39118451d69bd482a7c Mon Sep 17 00:00:00 2001 +From f9584fa25cb679943e978926af83dcb17597a76c Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,10 +7,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index b5b7e2874..d0f730ab4 100644 +index bc2d4012d..c31421c3e 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -4949,7 +4949,7 @@ wpa_supplicant_alloc(struct wpa_supplicant *parent) +@@ -5405,7 +5405,7 @@ wpa_supplicant_alloc(struct wpa_supplicant *parent) if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/recipes-connectivity/hostapd/files/320-optional_rfkill.patch b/recipes-connectivity/hostapd/files/320-optional_rfkill.patch index d39fc57..a27b9d3 100644 --- a/recipes-connectivity/hostapd/files/320-optional_rfkill.patch +++ b/recipes-connectivity/hostapd/files/320-optional_rfkill.patch @@ -1,4 +1,4 @@ -From 605b686b4a4eb2b091c79b8e0290f2899cc0cebd Mon Sep 17 00:00:00 2001 +From 20b84122399e878194d5757bbe637c4fed6d0f2e Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -8,10 +8,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/drivers/drivers.mak b/src/drivers/drivers.mak -index 55a98ef86..3900f04b9 100644 +index a03d4a034..8da44d9f5 100644 --- a/src/drivers/drivers.mak +++ b/src/drivers/drivers.mak -@@ -50,7 +50,6 @@ NEED_SME=y +@@ -54,7 +54,6 @@ NEED_SME=y NEED_AP_MLME=y NEED_NETLINK=y NEED_LINUX_IOCTL=y @@ -19,7 +19,7 @@ index 55a98ef86..3900f04b9 100644 NEED_RADIOTAP=y NEED_LIBNL=y endif -@@ -107,7 +106,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT +@@ -111,7 +110,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT CONFIG_WIRELESS_EXTENSION=y NEED_NETLINK=y NEED_LINUX_IOCTL=y @@ -27,7 +27,7 @@ index 55a98ef86..3900f04b9 100644 endif ifdef CONFIG_DRIVER_NDIS -@@ -133,7 +131,6 @@ endif +@@ -137,7 +135,6 @@ endif ifdef CONFIG_WIRELESS_EXTENSION DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION DRV_WPA_OBJS += ../src/drivers/driver_wext.o @@ -35,7 +35,7 @@ index 55a98ef86..3900f04b9 100644 endif ifdef NEED_NETLINK -@@ -142,6 +139,7 @@ endif +@@ -146,6 +143,7 @@ endif ifdef NEED_RFKILL DRV_OBJS += ../src/drivers/rfkill.o diff --git a/recipes-connectivity/hostapd/files/330-nl80211_fix_set_freq.patch b/recipes-connectivity/hostapd/files/330-nl80211_fix_set_freq.patch index 44ffc55..8531c69 100644 --- a/recipes-connectivity/hostapd/files/330-nl80211_fix_set_freq.patch +++ b/recipes-connectivity/hostapd/files/330-nl80211_fix_set_freq.patch @@ -1,4 +1,4 @@ -From 3234ba3f7b82868de03131e61363b21b6152c8d8 Mon Sep 17 00:00:00 2001 +From 7fafab3b02af33cb9cbb4c1ea7de83cfc6161a4a Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,12 +7,12 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 77db47ca7..6255d7956 100644 +index de6a6c2f6..d2b30a0b8 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4664,7 +4664,7 @@ static int nl80211_set_channel(struct i802_bss *bss, - freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled, - freq->bandwidth, freq->center_freq1, freq->center_freq2); +@@ -5011,7 +5011,7 @@ static int nl80211_set_channel(struct i802_bss *bss, + freq->he_enabled, freq->eht_enabled, freq->bandwidth, + freq->center_freq1, freq->center_freq2); - msg = nl80211_drv_msg(drv, 0, set_chan ? NL80211_CMD_SET_CHANNEL : + msg = nl80211_bss_msg(bss, 0, set_chan ? NL80211_CMD_SET_CHANNEL : diff --git a/recipes-connectivity/hostapd/files/340-reload_freq_change.patch b/recipes-connectivity/hostapd/files/340-reload_freq_change.patch index 152c8ff..3fcb988 100644 --- a/recipes-connectivity/hostapd/files/340-reload_freq_change.patch +++ b/recipes-connectivity/hostapd/files/340-reload_freq_change.patch @@ -1,16 +1,16 @@ -From 573db8335f27160dca96b2ac1f7f008a5aac15b2 Mon Sep 17 00:00:00 2001 +From a8e0a04a432c75c828a5ed0a56de0de2a3ea558f Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 --- - src/ap/hostapd.c | 49 ++++++++++++++++++++++++++++++++++--------------- - 1 file changed, 34 insertions(+), 15 deletions(-) + src/ap/hostapd.c | 50 +++++++++++++++++++++++++++++++++--------------- + 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index 1579ae7fe..3629f54ad 100644 +index 2b07a9283..f6c9c0e78 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -114,6 +114,28 @@ static void hostapd_reload_bss(struct hostapd_data *hapd) +@@ -119,6 +119,29 @@ static void hostapd_reload_bss(struct hostapd_data *hapd) #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; @@ -22,6 +22,7 @@ index 1579ae7fe..3629f54ad 100644 + hapd->iconf->ieee80211n, + hapd->iconf->ieee80211ac, + hapd->iconf->ieee80211ax, ++ hapd->iconf->ieee80211be, + hapd->iconf->secondary_channel, + hostapd_get_oper_chwidth(hapd->iconf), + hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf), @@ -39,7 +40,7 @@ index 1579ae7fe..3629f54ad 100644 if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* -@@ -215,6 +237,7 @@ int hostapd_reload_config(struct hostapd_iface *iface) +@@ -220,6 +243,7 @@ int hostapd_reload_config(struct hostapd_iface *iface) struct hostapd_data *hapd = iface->bss[0]; struct hostapd_config *newconf, *oldconf; size_t j; @@ -47,7 +48,7 @@ index 1579ae7fe..3629f54ad 100644 if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ -@@ -265,24 +288,20 @@ int hostapd_reload_config(struct hostapd_iface *iface) +@@ -270,24 +294,20 @@ int hostapd_reload_config(struct hostapd_iface *iface) } iface->conf = newconf; diff --git a/recipes-connectivity/hostapd/files/341-mesh-ctrl-iface-channel-switch.patch b/recipes-connectivity/hostapd/files/341-mesh-ctrl-iface-channel-switch.patch index 8228944..bb99e6e 100644 --- a/recipes-connectivity/hostapd/files/341-mesh-ctrl-iface-channel-switch.patch +++ b/recipes-connectivity/hostapd/files/341-mesh-ctrl-iface-channel-switch.patch @@ -1,4 +1,4 @@ -From 4e7d50b450dc603f19697c7de7c4d21b09489477 Mon Sep 17 00:00:00 2001 +From 2aeb1ad361356c6eca3101b00cd323490ad7d55a Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,10 +7,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c -index 2ec656255..0871c9b27 100644 +index 52b537e62..f21b8713f 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1466,15 +1466,35 @@ int ap_switch_channel(struct wpa_supplicant *wpa_s, +@@ -1803,15 +1803,35 @@ int ap_switch_channel(struct wpa_supplicant *wpa_s, #ifdef CONFIG_CTRL_IFACE diff --git a/recipes-connectivity/hostapd/files/350-nl80211_del_beacon_bss.patch b/recipes-connectivity/hostapd/files/350-nl80211_del_beacon_bss.patch index b4be472..f2abf51 100644 --- a/recipes-connectivity/hostapd/files/350-nl80211_del_beacon_bss.patch +++ b/recipes-connectivity/hostapd/files/350-nl80211_del_beacon_bss.patch @@ -1,34 +1,30 @@ -From e2b91f89250c5702aab0a51f7d7ae87164f23117 Mon Sep 17 00:00:00 2001 +From e89b089b1b199a7332e704de84f261c437d9f510 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 --- - src/drivers/driver_nl80211.c | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) + src/drivers/driver_nl80211.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 6255d7956..6267819a7 100644 +index d2b30a0b8..a9ae0fbe2 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -2806,10 +2806,15 @@ static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss) - struct nl_msg *msg; +@@ -2932,11 +2932,11 @@ static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss) struct wpa_driver_nl80211_data *drv = bss->drv; -+ if (!bss->beacon_set) -+ return 0; -+ -+ bss->beacon_set = 0; -+ wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)", - drv->ifindex); + bss->ifindex); + bss->beacon_set = 0; + bss->freq = 0; nl80211_put_wiphy_data_ap(bss); - msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON); -+ msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON); - return send_and_recv_msgs(drv, msg, NULL, NULL); ++ msg = nl80211_bss_msg(drv, 0, NL80211_CMD_DEL_BEACON); + return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); } -@@ -5279,7 +5284,7 @@ static void nl80211_teardown_ap(struct i802_bss *bss) +@@ -5650,7 +5650,7 @@ static void nl80211_teardown_ap(struct i802_bss *bss) nl80211_mgmt_unsubscribe(bss, "AP teardown"); nl80211_put_wiphy_data_ap(bss); @@ -37,7 +33,7 @@ index 6255d7956..6267819a7 100644 } -@@ -7697,8 +7702,6 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss, +@@ -8104,8 +8104,6 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss, } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); @@ -46,19 +42,3 @@ index 6255d7956..6267819a7 100644 nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -8092,7 +8095,6 @@ static int wpa_driver_nl80211_deinit_ap(void *priv) - if (!is_ap_interface(drv->nlmode)) - return -1; - wpa_driver_nl80211_del_beacon(bss); -- bss->beacon_set = 0; - - /* - * If the P2P GO interface was dynamically added, then it is -@@ -8112,7 +8114,6 @@ static int wpa_driver_nl80211_stop_ap(void *priv) - if (!is_ap_interface(drv->nlmode)) - return -1; - wpa_driver_nl80211_del_beacon(bss); -- bss->beacon_set = 0; - return 0; - } - diff --git a/recipes-connectivity/hostapd/files/360-ctrl_iface_reload.patch b/recipes-connectivity/hostapd/files/360-ctrl_iface_reload.patch index 348a64e..e1731d2 100644 --- a/recipes-connectivity/hostapd/files/360-ctrl_iface_reload.patch +++ b/recipes-connectivity/hostapd/files/360-ctrl_iface_reload.patch @@ -1,17 +1,17 @@ -From 17dfbd08ba654de9a83727a20b24dadcdc7e48e8 Mon Sep 17 00:00:00 2001 +From e949a35332f665fb789e2c4a07cfdacd635e67b8 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 --- - hostapd/ctrl_iface.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ - src/ap/ctrl_iface_ap.c | 8 ++++++- + hostapd/ctrl_iface.c | 59 ++++++++++++++++++++++++++++++++++++++++++ + src/ap/ctrl_iface_ap.c | 8 +++++- 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index b470c5643..2a077209f 100644 +index 664c59df7..8baa4a4d4 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -65,6 +65,7 @@ +@@ -67,6 +67,7 @@ #include "fst/fst_ctrl_iface.h" #include "config_file.h" #include "ctrl_iface.h" @@ -19,7 +19,7 @@ index b470c5643..2a077209f 100644 #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 -@@ -80,6 +81,7 @@ static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level, +@@ -82,6 +83,7 @@ static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level, enum wpa_msg_type type, const char *buf, size_t len); @@ -27,7 +27,7 @@ index b470c5643..2a077209f 100644 static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd, struct sockaddr_storage *from, -@@ -131,6 +133,61 @@ static int hostapd_ctrl_iface_new_sta(struct hostapd_data *hapd, +@@ -133,6 +135,61 @@ static int hostapd_ctrl_iface_new_sta(struct hostapd_data *hapd, return 0; } @@ -89,7 +89,7 @@ index b470c5643..2a077209f 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_process(struct hostapd_data *hapd, +@@ -3434,6 +3491,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); @@ -99,10 +99,10 @@ index b470c5643..2a077209f 100644 ieee802_1x_erp_flush(hapd); #ifdef RADIUS_SERVER diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c -index ef53a8254..b3abf7eca 100644 +index 29b41f5bc..5150d9bbf 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 char *pos, +@@ -945,7 +945,13 @@ int hostapd_parse_csa_settings(const char *pos, int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd) { diff --git a/recipes-connectivity/hostapd/files/370-ap_sta_support.patch b/recipes-connectivity/hostapd/files/370-ap_sta_support.patch index 5389ae0..3c1b1b1 100644 --- a/recipes-connectivity/hostapd/files/370-ap_sta_support.patch +++ b/recipes-connectivity/hostapd/files/370-ap_sta_support.patch @@ -1,44 +1,45 @@ -From 45243d01250613d2fd90b0ff0a4b5de8e50a2b92 Mon Sep 17 00:00:00 2001 +From d1928a9eedc0ce358521d6681c7f61d2e0da1316 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 --- - hostapd/ctrl_iface.c | 5 +++ + hostapd/ctrl_iface.c | 6 +++ src/ap/beacon.c | 5 --- - src/drivers/driver.h | 2 ++ - src/drivers/driver_nl80211_event.c | 6 +++- - wpa_supplicant/Makefile | 6 ++++ - wpa_supplicant/bss.c | 14 ++++++++ - wpa_supplicant/bss.h | 4 +++ - wpa_supplicant/events.c | 58 +++++++++++++++++++++++++++++++- - wpa_supplicant/main.c | 8 +++-- - wpa_supplicant/wpa_supplicant.c | 69 ++++++++++++++++++++++++++++++++++++++ - wpa_supplicant/wpa_supplicant_i.h | 7 ++++ - 11 files changed, 175 insertions(+), 9 deletions(-) + src/drivers/driver.h | 2 + + src/drivers/driver_nl80211_event.c | 6 ++- + wpa_supplicant/Makefile | 2 + + wpa_supplicant/bss.c | 14 ++++++ + wpa_supplicant/bss.h | 4 ++ + wpa_supplicant/events.c | 58 ++++++++++++++++++++++++- + wpa_supplicant/main.c | 8 +++- + wpa_supplicant/wpa_supplicant.c | 69 ++++++++++++++++++++++++++++++ + wpa_supplicant/wpa_supplicant_i.h | 7 +++ + 11 files changed, 172 insertions(+), 9 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index 2a077209f..ea2577f50 100644 +index 8baa4a4d4..193df6e11 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2712,6 +2712,11 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, +@@ -2626,6 +2626,12 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, return 0; } + if (os_strstr(pos, " auto-ht")) { + settings.freq_params.ht_enabled = iface->conf->ieee80211n; + settings.freq_params.vht_enabled = iface->conf->ieee80211ac; ++ settings.freq_params.he_enabled = iface->conf->ieee80211ax; + } + for (i = 0; i < iface->num_bss; i++) { - /* Save CHAN_SWITCH VHT config */ + /* Save CHAN_SWITCH VHT, HE, and EHT config */ diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index 22e672c8d..2c5859933 100644 +index 58872bfda..c8a0e51d3 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -1468,11 +1468,6 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd) - struct wpabuf *beacon, *proberesp, *assocresp; - int res, ret = -1; +@@ -1901,11 +1901,6 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd) + return -1; + } - if (hapd->csa_in_progress) { - wpa_printf(MSG_ERROR, "Cannot set beacons during CSA period"); @@ -49,10 +50,10 @@ index 22e672c8d..2c5859933 100644 if (ieee802_11_build_ap_params(hapd, ¶ms) < 0) diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 9f5ded44e..0f565cb56 100644 +index f8f91c023..f7dfcc165 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5690,6 +5690,7 @@ union wpa_event_data { +@@ -5965,6 +5965,7 @@ union wpa_event_data { /** * struct ch_switch @@ -60,7 +61,7 @@ index 9f5ded44e..0f565cb56 100644 * @freq: Frequency of new channel in MHz * @ht_enabled: Whether this is an HT channel * @ch_offset: Secondary channel offset -@@ -5698,6 +5699,7 @@ union wpa_event_data { +@@ -5973,6 +5974,7 @@ union wpa_event_data { * @cf2: Center frequency 2 */ struct ch_switch { @@ -69,10 +70,10 @@ index 9f5ded44e..0f565cb56 100644 int ht_enabled; int ch_offset; diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c -index 6a2de1f3c..013e4268e 100644 +index 00f8b0cbb..a67b4818a 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c -@@ -541,7 +541,7 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv, +@@ -691,7 +691,7 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv, struct nlattr *ifindex, struct nlattr *freq, struct nlattr *type, struct nlattr *bw, struct nlattr *cf1, struct nlattr *cf2, @@ -81,7 +82,7 @@ index 6a2de1f3c..013e4268e 100644 { struct i802_bss *bss; union wpa_event_data data; -@@ -600,6 +600,8 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv, +@@ -752,6 +752,8 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv, data.ch_switch.cf1 = nla_get_u32(cf1); if (cf2) data.ch_switch.cf2 = nla_get_u32(cf2); @@ -90,7 +91,7 @@ index 6a2de1f3c..013e4268e 100644 if (finished) bss->freq = data.ch_switch.freq; -@@ -2686,6 +2688,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, +@@ -3115,6 +3117,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, tb[NL80211_ATTR_CHANNEL_WIDTH], tb[NL80211_ATTR_CENTER_FREQ1], tb[NL80211_ATTR_CENTER_FREQ2], @@ -98,7 +99,7 @@ index 6a2de1f3c..013e4268e 100644 0); break; case NL80211_CMD_CH_SWITCH_NOTIFY: -@@ -2696,6 +2699,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, +@@ -3125,6 +3128,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, tb[NL80211_ATTR_CHANNEL_WIDTH], tb[NL80211_ATTR_CENTER_FREQ1], tb[NL80211_ATTR_CENTER_FREQ2], @@ -107,21 +108,10 @@ index 6a2de1f3c..013e4268e 100644 break; case NL80211_CMD_DISCONNECT: diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile -index d5caf23a3..547e9b64b 100644 +index f7740e6f0..969dc713f 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -26,6 +26,10 @@ CFLAGS += $(EXTRA_CFLAGS) - CFLAGS += -I$(abspath ../src) - CFLAGS += -I$(abspath ../src/utils) - -+ifdef MULTICALL -+CFLAGS += -DMULTICALL -+endif -+ - -include .config - -include $(if $(MULTICALL),../hostapd/.config) - -@@ -118,6 +122,8 @@ OBJS_c += ../src/utils/common.o +@@ -115,6 +115,8 @@ OBJS_c += ../src/utils/common.o OBJS_c += ../src/common/cli.o OBJS += wmm_ac.o @@ -131,7 +121,7 @@ index d5caf23a3..547e9b64b 100644 ifdef CONFIG_NATIVE_WINDOWS CONFIG_OS=win32 diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c -index 127f43e5e..d0f5058a5 100644 +index eb97a618d..01ddb13ec 100644 --- a/wpa_supplicant/bss.c +++ b/wpa_supplicant/bss.c @@ -11,6 +11,7 @@ @@ -142,7 +132,7 @@ index 127f43e5e..d0f5058a5 100644 #include "drivers/driver.h" #include "eap_peer/eap.h" #include "wpa_supplicant_i.h" -@@ -294,6 +295,10 @@ void calculate_update_time(const struct os_reltime *fetch_time, +@@ -282,6 +283,10 @@ void calculate_update_time(const struct os_reltime *fetch_time, static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, struct os_reltime *fetch_time) { @@ -153,7 +143,7 @@ index 127f43e5e..d0f5058a5 100644 dst->flags = src->flags; os_memcpy(dst->bssid, src->bssid, ETH_ALEN); dst->freq = src->freq; -@@ -306,6 +311,15 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, +@@ -295,6 +300,15 @@ static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, dst->est_throughput = src->est_throughput; dst->snr = src->snr; @@ -170,10 +160,10 @@ index 127f43e5e..d0f5058a5 100644 } diff --git a/wpa_supplicant/bss.h b/wpa_supplicant/bss.h -index 071676174..e1c48b1a5 100644 +index 146aaee7f..2f37e8d1c 100644 --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h -@@ -83,6 +83,10 @@ struct wpa_bss { +@@ -94,6 +94,10 @@ struct wpa_bss { u8 ssid[SSID_MAX_LEN]; /** Length of SSID */ size_t ssid_len; @@ -185,10 +175,10 @@ index 071676174..e1c48b1a5 100644 int freq; /** Beacon interval in TUs (host byte order) */ diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c -index af91bae4e..e3b1f8343 100644 +index 48aa792b3..86a0dc7fa 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4579,6 +4579,60 @@ static void wpas_event_unprot_beacon(struct wpa_supplicant *wpa_s, +@@ -4953,6 +4953,60 @@ static void wpas_event_unprot_beacon(struct wpa_supplicant *wpa_s, } @@ -249,7 +239,7 @@ index af91bae4e..e3b1f8343 100644 void supplicant_event(void *ctx, enum wpa_event_type event, union wpa_event_data *data) { -@@ -4881,8 +4935,10 @@ void supplicant_event(void *ctx, enum wpa_event_type event, +@@ -5268,8 +5322,10 @@ void supplicant_event(void *ctx, enum wpa_event_type event, channel_width_to_string(data->ch_switch.ch_width), data->ch_switch.cf1, data->ch_switch.cf2); @@ -262,10 +252,10 @@ index af91bae4e..e3b1f8343 100644 wpa_s->assoc_freq = data->ch_switch.freq; wpa_s->current_ssid->frequency = data->ch_switch.freq; diff --git a/wpa_supplicant/main.c b/wpa_supplicant/main.c -index 51a8a0298..669f5b0b6 100644 +index 9229eb51f..535923ecd 100644 --- a/wpa_supplicant/main.c +++ b/wpa_supplicant/main.c -@@ -34,7 +34,7 @@ static void usage(void) +@@ -35,7 +35,7 @@ static void usage(void) "vW] [-P] " "[-g] \\\n" " [-G] \\\n" @@ -274,7 +264,7 @@ index 51a8a0298..669f5b0b6 100644 "[-p] \\\n" " [-b] [-e]" #ifdef CONFIG_DEBUG_FILE -@@ -74,6 +74,7 @@ static void usage(void) +@@ -75,6 +75,7 @@ static void usage(void) " -g = global ctrl_interface\n" " -G = global ctrl_interface group\n" " -h = show this help text\n" @@ -282,7 +272,7 @@ index 51a8a0298..669f5b0b6 100644 " -i = interface name\n" " -I = additional configuration file\n" " -K = include keys (passwords, etc.) in debug output\n" -@@ -201,7 +202,7 @@ int main(int argc, char *argv[]) +@@ -202,7 +203,7 @@ int main(int argc, char *argv[]) for (;;) { c = getopt(argc, argv, @@ -291,7 +281,7 @@ index 51a8a0298..669f5b0b6 100644 if (c < 0) break; switch (c) { -@@ -248,6 +249,9 @@ int main(int argc, char *argv[]) +@@ -249,6 +250,9 @@ int main(int argc, char *argv[]) usage(); exitcode = 0; goto out; @@ -302,10 +292,10 @@ index 51a8a0298..669f5b0b6 100644 iface->ifname = optarg; break; diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index d0f730ab4..25b5340a8 100644 +index c31421c3e..c18723384 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -129,6 +129,54 @@ static void wpas_update_fils_connect_params(struct wpa_supplicant *wpa_s); +@@ -131,6 +131,54 @@ static void wpas_update_fils_connect_params(struct wpa_supplicant *wpa_s); static void wpas_update_owe_connect_params(struct wpa_supplicant *wpa_s); #endif /* CONFIG_OWE */ @@ -360,7 +350,7 @@ index d0f730ab4..25b5340a8 100644 #ifdef CONFIG_WEP /* Configure default/group WEP keys for static WEP */ -@@ -991,6 +1039,8 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, +@@ -1016,6 +1064,8 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, sme_sched_obss_scan(wpa_s, 1); @@ -369,7 +359,7 @@ index d0f730ab4..25b5340a8 100644 #if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL) if (!fils_hlp_sent && ssid && ssid->eap.erp) update_fils_connect_params = true; -@@ -1001,6 +1051,8 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, +@@ -1026,6 +1076,8 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, #endif /* CONFIG_OWE */ } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING || state == WPA_ASSOCIATED) { @@ -378,7 +368,7 @@ index d0f730ab4..25b5340a8 100644 wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -2225,6 +2277,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, +@@ -2324,6 +2376,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, return; } wpa_s->current_bss = bss; @@ -387,7 +377,7 @@ index d0f730ab4..25b5340a8 100644 #else /* CONFIG_MESH */ wpa_msg(wpa_s, MSG_ERROR, "mesh mode support not included in the build"); -@@ -6207,6 +6261,16 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s, +@@ -6679,6 +6733,16 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s, sizeof(wpa_s->bridge_ifname)); } @@ -404,7 +394,7 @@ index d0f730ab4..25b5340a8 100644 /* RSNA Supplicant Key Management - INITIALIZE */ 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(struct wpa_supplicant *wpa_s, +@@ -7017,6 +7081,11 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s, if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); @@ -413,26 +403,26 @@ index d0f730ab4..25b5340a8 100644 + wpa_s->hostapd = NULL; + } + - if (wpa_s->ctrl_iface) { - wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface); - wpa_s->ctrl_iface = NULL; + wpa_supplicant_ctrl_iface_deinit(wpa_s, wpa_s->ctrl_iface); + wpa_s->ctrl_iface = NULL; + diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h -index 28867f04e..9b60dfc42 100644 +index 301d5d56a..2f121462a 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -104,6 +104,11 @@ struct wpa_interface { + */ const char *ifname; - /** ++ /** + * hostapd_ctrl - path to hostapd control socket for notification + */ + const char *hostapd_ctrl; + -+ /** + /** * bridge_ifname - Optional bridge interface name * - * If the driver interface (ifname) is included in a Linux bridge -@@ -530,6 +535,8 @@ struct wpa_supplicant { +@@ -719,6 +724,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_BINDER */ char bridge_ifname[16]; diff --git a/recipes-connectivity/hostapd/files/380-disable_ctrl_iface_mib.patch b/recipes-connectivity/hostapd/files/380-disable_ctrl_iface_mib.patch index dccfd16..d9187c9 100644 --- a/recipes-connectivity/hostapd/files/380-disable_ctrl_iface_mib.patch +++ b/recipes-connectivity/hostapd/files/380-disable_ctrl_iface_mib.patch @@ -1,4 +1,4 @@ -From 8d08dd5ef716f86676eb4ef7c4c401010c44ef01 Mon Sep 17 00:00:00 2001 +From e54c0492fd8d13ce2e4dd9f7f6301bbeb2afd155 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -15,10 +15,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 9 files changed, 27 insertions(+), 5 deletions(-) diff --git a/hostapd/Makefile b/hostapd/Makefile -index dae9cd119..abd2acdc9 100644 +index 6c34c5f88..6a125ed80 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -226,6 +226,9 @@ endif +@@ -221,6 +221,9 @@ endif ifdef CONFIG_NO_CTRL_IFACE CFLAGS += -DCONFIG_NO_CTRL_IFACE else @@ -29,10 +29,10 @@ index dae9cd119..abd2acdc9 100644 CFLAGS += -DCONFIG_CTRL_IFACE_UDP else diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index ea2577f50..13d7aba60 100644 +index 193df6e11..9215ab739 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3370,6 +3370,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, +@@ -3250,6 +3250,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, reply_size); } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { reply_len = hostapd_drv_status(hapd, reply, reply_size); @@ -40,7 +40,7 @@ index ea2577f50..13d7aba60 100644 } else if (os_strcmp(buf, "MIB") == 0) { reply_len = ieee802_11_get_mib(hapd, reply, reply_size); if (reply_len >= 0) { -@@ -3411,6 +3412,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, +@@ -3291,6 +3292,7 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); @@ -49,18 +49,18 @@ index ea2577f50..13d7aba60 100644 if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL)) reply_len = -1; diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c -index b3abf7eca..dc7c6c35d 100644 +index 5150d9bbf..c496e4f4a 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c -@@ -25,6 +25,7 @@ - #include "mbo_ap.h" +@@ -26,6 +26,7 @@ #include "taxonomy.h" + #include "wnm_ap.h" +#ifdef CONFIG_CTRL_IFACE_MIB 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 hostapd_data *hapd, const char *txtaddr, +@@ -460,6 +461,7 @@ int hostapd_ctrl_iface_sta_next(struct hostapd_data *hapd, const char *txtaddr, return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); } @@ -68,7 +68,7 @@ index b3abf7eca..dc7c6c35d 100644 #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 hostapd_data *hapd, char *buf, +@@ -832,12 +834,12 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf, return len; len += ret; } @@ -84,10 +84,10 @@ index b3abf7eca..dc7c6c35d 100644 ret = os_snprintf(buf + len, buflen - len, "supported_rates="); if (os_snprintf_error(buflen - len, ret)) diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c -index ee095f618..9ee99cff3 100644 +index d90792c78..7854de1a2 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -2711,6 +2711,7 @@ static const char * bool_txt(bool val) +@@ -2740,6 +2740,7 @@ static const char * bool_txt(bool val) return val ? "TRUE" : "FALSE"; } @@ -95,7 +95,7 @@ index ee095f618..9ee99cff3 100644 int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) { -@@ -2897,6 +2898,7 @@ int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, +@@ -2926,6 +2927,7 @@ int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, return len; } @@ -104,10 +104,10 @@ index ee095f618..9ee99cff3 100644 #ifdef CONFIG_HS20 static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c -index 9e6c0cad3..c43cfed78 100644 +index 705517b16..6fb23947b 100644 --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -4451,6 +4451,7 @@ static const char * wpa_bool_txt(int val) +@@ -4559,6 +4559,7 @@ static const char * wpa_bool_txt(int val) return val ? "TRUE" : "FALSE"; } @@ -115,7 +115,7 @@ index 9e6c0cad3..c43cfed78 100644 #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ -@@ -4601,7 +4602,7 @@ int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen) +@@ -4709,7 +4710,7 @@ int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen) return len; } @@ -125,10 +125,10 @@ index 9e6c0cad3..c43cfed78 100644 void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth) { diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c -index 0ae73e8f3..316fd461d 100644 +index 577717611..27bb644be 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_sm *sm) +@@ -2801,6 +2801,8 @@ static u32 wpa_key_mgmt_suite(struct wpa_sm *sm) } @@ -137,7 +137,7 @@ index 0ae73e8f3..316fd461d 100644 #define RSN_SUITE "%02x-%02x-%02x-%d" #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, char *buf, size_t buflen) +@@ -2882,6 +2884,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen) return (int) len; } @@ -146,10 +146,10 @@ index 0ae73e8f3..316fd461d 100644 diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile -index 547e9b64b..16ea58f4a 100644 +index 969dc713f..57a89edcb 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -952,6 +952,9 @@ ifdef CONFIG_FILS +@@ -973,6 +973,9 @@ ifdef CONFIG_FILS OBJS += ../src/ap/fils_hlp.o endif ifdef CONFIG_CTRL_IFACE @@ -160,10 +160,10 @@ index 547e9b64b..16ea58f4a 100644 endif diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c -index 0871c9b27..c67f41c3a 100644 +index f21b8713f..992c0a056 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1324,7 +1324,7 @@ int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s, +@@ -1477,7 +1477,7 @@ int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s, #endif /* CONFIG_WPS */ @@ -173,10 +173,10 @@ index 0871c9b27..c67f41c3a 100644 int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s, char *buf, size_t buflen) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c -index 298f3c442..4e07a4336 100644 +index 499e6d3dd..0b931a7d5 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -2267,7 +2267,7 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s, +@@ -2325,7 +2325,7 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s, pos += ret; } @@ -185,7 +185,7 @@ index 298f3c442..4e07a4336 100644 if (wpa_s->ap_iface) { pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -10366,6 +10366,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, +@@ -11521,6 +11521,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -193,7 +193,7 @@ index 298f3c442..4e07a4336 100644 } else if (os_strcmp(buf, "MIB") == 0) { 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(struct wpa_supplicant *wpa_s, +@@ -11533,6 +11534,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, reply_size - reply_len); #endif /* CONFIG_MACSEC */ } @@ -201,7 +201,7 @@ index 298f3c442..4e07a4336 100644 } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -10862,6 +10864,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, +@@ -12021,6 +12023,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -209,7 +209,7 @@ index 298f3c442..4e07a4336 100644 } else if (os_strcmp(buf, "STA-FIRST") == 0) { 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(struct wpa_supplicant *wpa_s, +@@ -12029,12 +12032,15 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); diff --git a/recipes-connectivity/hostapd/files/381-hostapd_cli_UNKNOWN-COMMAND.patch b/recipes-connectivity/hostapd/files/381-hostapd_cli_UNKNOWN-COMMAND.patch index ff1f6ed..2ef3bee 100644 --- a/recipes-connectivity/hostapd/files/381-hostapd_cli_UNKNOWN-COMMAND.patch +++ b/recipes-connectivity/hostapd/files/381-hostapd_cli_UNKNOWN-COMMAND.patch @@ -1,4 +1,4 @@ -From 1417df0236f3b7e509bc2087f9603c92e3f4653e Mon Sep 17 00:00:00 2001 +From 0111fae9ca0184e10b60494c4ecdc27f2636bc17 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,7 +7,7 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c -index 440664e9b..10f44d4ce 100644 +index 60396f3da..ad39aeb3b 100644 --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c @@ -744,7 +744,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd, diff --git a/recipes-connectivity/hostapd/files/390-wpa_ie_cap_workaround.patch b/recipes-connectivity/hostapd/files/390-wpa_ie_cap_workaround.patch index f67cbb5..7ce7872 100644 --- a/recipes-connectivity/hostapd/files/390-wpa_ie_cap_workaround.patch +++ b/recipes-connectivity/hostapd/files/390-wpa_ie_cap_workaround.patch @@ -1,4 +1,4 @@ -From bf2d36c1e43219c8b322d947aee360c0b0f27791 Mon Sep 17 00:00:00 2001 +From 09a00a07a0db13618bad412c058c9d4786f2264b Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,10 +7,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c -index 82a5a174f..2fd743cc8 100644 +index 587cd88b2..2b2b09fb9 100644 --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -2121,6 +2121,31 @@ u32 wpa_akm_to_suite(int akm) +@@ -2451,6 +2451,31 @@ u32 wpa_akm_to_suite(int akm) } @@ -42,7 +42,7 @@ index 82a5a174f..2fd743cc8 100644 int wpa_compare_rsn_ie(int ft_initial_assoc, const u8 *ie1, size_t ie1len, const u8 *ie2, size_t ie2len) -@@ -2128,8 +2153,19 @@ int wpa_compare_rsn_ie(int ft_initial_assoc, +@@ -2458,8 +2483,19 @@ int wpa_compare_rsn_ie(int ft_initial_assoc, if (ie1 == NULL || ie2 == NULL) return -1; diff --git a/recipes-connectivity/hostapd/files/400-wps_single_auth_enc_type.patch b/recipes-connectivity/hostapd/files/400-wps_single_auth_enc_type.patch index 1352ed2..a5cd4af 100644 --- a/recipes-connectivity/hostapd/files/400-wps_single_auth_enc_type.patch +++ b/recipes-connectivity/hostapd/files/400-wps_single_auth_enc_type.patch @@ -1,4 +1,4 @@ -From 2b64e885c82997a8abe3d0ea767a3e1137f50a29 Mon Sep 17 00:00:00 2001 +From 1c7809b15fab60dd8781248bd53ee4760d3c3ace Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,7 +7,7 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c -index ff942a67b..18925f0c3 100644 +index aacfa3372..0c351af5f 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -394,9 +394,8 @@ static int hapd_wps_reconfig_in_memory(struct hostapd_data *hapd, @@ -21,7 +21,7 @@ index ff942a67b..18925f0c3 100644 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 *hapd, +@@ -1181,8 +1180,7 @@ int hostapd_init_wps(struct hostapd_data *hapd, WPA_CIPHER_GCMP_256)) { wps->encr_types |= WPS_ENCR_AES; wps->encr_types_rsn |= WPS_ENCR_AES; diff --git a/recipes-connectivity/hostapd/files/410-limit_debug_messages.patch b/recipes-connectivity/hostapd/files/410-limit_debug_messages.patch index 937521b..235ffa8 100644 --- a/recipes-connectivity/hostapd/files/410-limit_debug_messages.patch +++ b/recipes-connectivity/hostapd/files/410-limit_debug_messages.patch @@ -1,10 +1,10 @@ -From d7da847c66bbd576a924e6bf777813203f2b87c1 Mon Sep 17 00:00:00 2001 +From 833a09ecb52559b9dcef824ff29620d12a88f085 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 --- - src/utils/wpa_debug.c | 36 ++++----------------------- - src/utils/wpa_debug.h | 69 ++++++++++++++++++++++++++++++++++++++++++++------- + src/utils/wpa_debug.c | 36 ++++------------------ + src/utils/wpa_debug.h | 69 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 65 insertions(+), 40 deletions(-) diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c diff --git a/recipes-connectivity/hostapd/files/420-indicate-features.patch b/recipes-connectivity/hostapd/files/420-indicate-features.patch index 143b31e..4eab7c2 100644 --- a/recipes-connectivity/hostapd/files/420-indicate-features.patch +++ b/recipes-connectivity/hostapd/files/420-indicate-features.patch @@ -1,34 +1,35 @@ -From f9f005742a0182819f1f1e737a1abf671d4b4a5a Mon Sep 17 00:00:00 2001 +From 86099ab5f18972ae8fb503c2f3eead226486cb2d Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 --- - hostapd/main.c | 5 ++++- + hostapd/main.c | 6 ++++-- wpa_supplicant/main.c | 11 ++++++++--- - 2 files changed, 12 insertions(+), 4 deletions(-) + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/hostapd/main.c b/hostapd/main.c -index 2bebdfe86..4f7d5184d 100644 +index 6a7b91bf2..0c972bba9 100644 --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -15,6 +15,7 @@ - #include "utils/common.h" - #include "utils/eloop.h" - #include "utils/uuid.h" -+#include "utils/build_features.h" - #include "crypto/random.h" - #include "crypto/tls.h" - #include "common/version.h" -@@ -692,7 +693,7 @@ int main(int argc, char *argv[]) +@@ -31,7 +31,7 @@ + #include "config_file.h" + #include "eap_register.h" + #include "ctrl_iface.h" +- ++#include "build_features.h" + + struct hapd_global { + void **drv_priv; +@@ -692,7 +692,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { -- c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); -+ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:v::"); +- c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q"); ++ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::"); if (c < 0) break; switch (c) { -@@ -729,6 +730,8 @@ int main(int argc, char *argv[]) +@@ -729,6 +729,8 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': @@ -36,9 +37,9 @@ index 2bebdfe86..4f7d5184d 100644 + exit(!has_feature(optarg)); show_version(); exit(1); - break; + case 'g': diff --git a/wpa_supplicant/main.c b/wpa_supplicant/main.c -index 669f5b0b6..3d7f1ba6e 100644 +index 535923ecd..5ebda5a67 100644 --- a/wpa_supplicant/main.c +++ b/wpa_supplicant/main.c @@ -12,6 +12,7 @@ @@ -46,10 +47,10 @@ index 669f5b0b6..3d7f1ba6e 100644 #include "common.h" +#include "build_features.h" + #include "crypto/crypto.h" #include "fst/fst.h" #include "wpa_supplicant_i.h" - #include "driver_i.h" -@@ -202,7 +203,7 @@ int main(int argc, char *argv[]) +@@ -203,7 +204,7 @@ int main(int argc, char *argv[]) for (;;) { c = getopt(argc, argv, @@ -58,7 +59,7 @@ index 669f5b0b6..3d7f1ba6e 100644 if (c < 0) break; switch (c) { -@@ -305,8 +306,12 @@ int main(int argc, char *argv[]) +@@ -306,8 +307,12 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ case 'v': diff --git a/recipes-connectivity/hostapd/files/430-hostapd_cli_ifdef.patch b/recipes-connectivity/hostapd/files/430-hostapd_cli_ifdef.patch index 2be3c5f..d168a33 100644 --- a/recipes-connectivity/hostapd/files/430-hostapd_cli_ifdef.patch +++ b/recipes-connectivity/hostapd/files/430-hostapd_cli_ifdef.patch @@ -1,4 +1,4 @@ -From ad299f46a1a3e710901696888e05cbe8d6bd03bf Mon Sep 17 00:00:00 2001 +From cbf654d789340c578f1cd6648670f7c242c8dcfa Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,7 +7,7 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 8 deletions(-) diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c -index 10f44d4ce..24abfe33b 100644 +index ad39aeb3b..6b5387869 100644 --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c @@ -388,7 +388,6 @@ static int hostapd_cli_cmd_disassociate(struct wpa_ctrl *ctrl, int argc, @@ -42,7 +42,7 @@ index 10f44d4ce..24abfe33b 100644 static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -1532,13 +1528,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { +@@ -1579,13 +1575,10 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { { "disassociate", hostapd_cli_cmd_disassociate, hostapd_complete_stations, " = disassociate a station" }, @@ -56,7 +56,7 @@ index 10f44d4ce..24abfe33b 100644 { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, " [timeout] [addr] = add WPS Enrollee PIN" }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, -@@ -1563,7 +1556,6 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { +@@ -1610,7 +1603,6 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { " = configure AP" }, { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, "= show current WPS status" }, diff --git a/recipes-connectivity/hostapd/files/431-wpa_cli_ifdef.patch b/recipes-connectivity/hostapd/files/431-wpa_cli_ifdef.patch index 1cdcaa1..a8a148b 100644 --- a/recipes-connectivity/hostapd/files/431-wpa_cli_ifdef.patch +++ b/recipes-connectivity/hostapd/files/431-wpa_cli_ifdef.patch @@ -1,4 +1,4 @@ -From aa0514e3ed13059846e7e3fcbefe2df8992bb6bc Mon Sep 17 00:00:00 2001 +From ee90e69b78884550b098dff70cd9df02834d6a21 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,7 +7,7 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 9 insertions(+) diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c -index f5b02f662..f70c42f0c 100644 +index 0e2315d25..91e07427f 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -26,6 +26,15 @@ diff --git a/recipes-connectivity/hostapd/files/432-missing-typedef.patch b/recipes-connectivity/hostapd/files/432-missing-typedef.patch index aa2e262..ce22da2 100644 --- a/recipes-connectivity/hostapd/files/432-missing-typedef.patch +++ b/recipes-connectivity/hostapd/files/432-missing-typedef.patch @@ -1,4 +1,4 @@ -From e2b9aa2d8a8326dba7b42c48069700d22d8be256 Mon Sep 17 00:00:00 2001 +From 5c6d5f192b60fc0dd14085af9e4e530dbc7f359d Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 diff --git a/recipes-connectivity/hostapd/files/450-scan_wait.patch b/recipes-connectivity/hostapd/files/450-scan_wait.patch index 63d8f35..ce851c1 100644 --- a/recipes-connectivity/hostapd/files/450-scan_wait.patch +++ b/recipes-connectivity/hostapd/files/450-scan_wait.patch @@ -1,4 +1,4 @@ -From cd5afa9d5b7c24a72965d57e37c308ab80f333b6 Mon Sep 17 00:00:00 2001 +From 45669a452a963ac83bb788d66879f58e6feb894e Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,7 +7,7 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/hostapd/main.c b/hostapd/main.c -index 4f7d5184d..9b44f4d41 100644 +index 0c972bba9..859ff3046 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -39,6 +39,8 @@ struct hapd_global { diff --git a/recipes-connectivity/hostapd/files/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/recipes-connectivity/hostapd/files/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index 7372bb7..24e847c 100644 --- a/recipes-connectivity/hostapd/files/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/recipes-connectivity/hostapd/files/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -1,4 +1,4 @@ -From 4edea7c948212283defa9b7685daa7a5a37535d2 Mon Sep 17 00:00:00 2001 +From a25ddcc5458fce3ca367d3d24d2a6ba8e7291689 Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Sun, 3 Jun 2012 18:22:56 +0200 Subject: [PATCH] wpa_supplicant: add new config params to be used with the @@ -8,13 +8,13 @@ Signed-hostap: Antonio Quartulli --- src/drivers/driver.h | 4 ++ - wpa_supplicant/config.c | 94 +++++++++++++++++++++++++++++++++++++++++ - wpa_supplicant/config_ssid.h | 5 +++ + wpa_supplicant/config.c | 94 +++++++++++++++++++++++++++++++++ + wpa_supplicant/config_ssid.h | 5 ++ wpa_supplicant/wpa_supplicant.c | 6 +++ 4 files changed, 109 insertions(+) diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 0f565cb56..6e3bd2230 100644 +index f7dfcc165..3c2a25ce8 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -19,6 +19,7 @@ @@ -25,7 +25,7 @@ index 0f565cb56..6e3bd2230 100644 #include "common/defs.h" #include "common/ieee802_11_defs.h" #include "common/wpa_common.h" -@@ -850,6 +851,9 @@ struct wpa_driver_associate_params { +@@ -893,6 +894,9 @@ struct wpa_driver_associate_params { * responsible for selecting with which BSS to associate. */ const u8 *bssid; @@ -36,7 +36,7 @@ index 0f565cb56..6e3bd2230 100644 * bssid_hint - BSSID of a proposed AP * diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index 61a5e1c60..69c2eb03b 100644 +index ec8301ab9..57a8dd4fb 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -18,6 +18,7 @@ @@ -47,7 +47,7 @@ index 61a5e1c60..69c2eb03b 100644 #include "config.h" -@@ -2269,6 +2270,97 @@ static char * wpa_config_write_peerkey(const struct parse_data *data, +@@ -2321,6 +2322,97 @@ static char * wpa_config_write_peerkey(const struct parse_data *data, #endif /* NO_CONFIG_WRITE */ @@ -145,7 +145,7 @@ index 61a5e1c60..69c2eb03b 100644 /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2552,6 +2644,8 @@ static const struct parse_data ssid_fields[] = { +@@ -2605,6 +2697,8 @@ static const struct parse_data ssid_fields[] = { { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, @@ -155,7 +155,7 @@ index 61a5e1c60..69c2eb03b 100644 { INT_RANGE(macsec_policy, 0, 1) }, { INT_RANGE(macsec_integ_only, 0, 1) }, diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h -index 2e205c08a..f1a1893c8 100644 +index d5c90122a..de664371c 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -10,8 +10,10 @@ @@ -169,7 +169,7 @@ index 2e205c08a..f1a1893c8 100644 #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1) -@@ -843,6 +845,9 @@ struct wpa_ssid { +@@ -846,6 +848,9 @@ struct wpa_ssid { */ void *parent_cred; @@ -180,10 +180,10 @@ index 2e205c08a..f1a1893c8 100644 /** * macsec_policy - Determines the policy for MACsec secure session diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index 25b5340a8..44f6b90b4 100644 +index c18723384..605b81179 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3638,6 +3638,12 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit) +@@ -3883,6 +3883,12 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit) params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/recipes-connectivity/hostapd/files/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/recipes-connectivity/hostapd/files/461-driver_nl80211-use-new-parameters-during-ibss-join.patch index a54adee..9982ac3 100644 --- a/recipes-connectivity/hostapd/files/461-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/recipes-connectivity/hostapd/files/461-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -1,4 +1,4 @@ -From 89676e86a2719b0a9991d69bd46a1c6e8cb995bf Mon Sep 17 00:00:00 2001 +From 62c9667d1f53d9e7612352b497b67224063049bb Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Sun, 3 Jun 2012 18:42:25 +0200 Subject: [PATCH] driver_nl80211: use new parameters during ibss join @@ -10,10 +10,10 @@ Signed-hostap: Antonio Quartulli 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 6267819a7..7f87b8482 100644 +index a9ae0fbe2..17875670d 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -5602,7 +5602,7 @@ static int wpa_driver_nl80211_ibss(struct wpa_driver_nl80211_data *drv, +@@ -5994,7 +5994,7 @@ static int wpa_driver_nl80211_ibss(struct wpa_driver_nl80211_data *drv, struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -22,7 +22,7 @@ index 6267819a7..7f87b8482 100644 int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -5629,6 +5629,37 @@ retry: +@@ -6021,6 +6021,37 @@ retry: nl80211_put_beacon_int(msg, params->beacon_int)) goto fail; diff --git a/recipes-connectivity/hostapd/files/463-add-mcast_rate-to-11s.patch b/recipes-connectivity/hostapd/files/463-add-mcast_rate-to-11s.patch index 57a67cc..48c025b 100644 --- a/recipes-connectivity/hostapd/files/463-add-mcast_rate-to-11s.patch +++ b/recipes-connectivity/hostapd/files/463-add-mcast_rate-to-11s.patch @@ -1,4 +1,4 @@ -From 8a960028810582f9ae32dc1e6e7d37cbc33b6fd7 Mon Sep 17 00:00:00 2001 +From e46daac3ce5e3d0d9c43f21fd895ecbab247d00e Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 11 May 2017 08:21:45 +0200 Subject: [PATCH] set mcast_rate in mesh mode @@ -25,22 +25,22 @@ Tested-by: Simon Wunderlich 3 files changed, 15 insertions(+) diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 6e3bd2230..05ec9c23e 100644 +index 3c2a25ce8..836c16b91 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1549,6 +1549,7 @@ struct wpa_driver_mesh_join_params { +@@ -1660,6 +1660,7 @@ struct wpa_driver_mesh_join_params { #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 unsigned int flags; - u8 handle_dfs; + bool handle_dfs; + int mcast_rate; }; struct wpa_driver_set_key_params { diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 7f87b8482..948f3c6fa 100644 +index 17875670d..69afdabbc 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10061,6 +10061,18 @@ static int nl80211_put_mesh_id(struct nl_msg *msg, const u8 *mesh_id, +@@ -10611,6 +10611,18 @@ static int nl80211_put_mesh_id(struct nl_msg *msg, const u8 *mesh_id, } @@ -59,7 +59,7 @@ index 7f87b8482..948f3c6fa 100644 static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -10122,6 +10134,7 @@ static int nl80211_join_mesh(struct i802_bss *bss, +@@ -10672,6 +10684,7 @@ static int nl80211_join_mesh(struct i802_bss *bss, 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) || @@ -68,10 +68,10 @@ index 7f87b8482..948f3c6fa 100644 goto fail; diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c -index e46435c66..a81a97d12 100644 +index ad067da67..2cbe8e366 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -592,6 +592,7 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, +@@ -632,6 +632,7 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, params->meshid = ssid->ssid; params->meshid_len = ssid->ssid_len; diff --git a/recipes-connectivity/hostapd/files/464-fix-mesh-obss-check.patch b/recipes-connectivity/hostapd/files/464-fix-mesh-obss-check.patch index 4e59c43..4fbc26a 100644 --- a/recipes-connectivity/hostapd/files/464-fix-mesh-obss-check.patch +++ b/recipes-connectivity/hostapd/files/464-fix-mesh-obss-check.patch @@ -1,4 +1,4 @@ -From 5b5baca0e74062b5642c23c44cad656b3d2a1ee9 Mon Sep 17 00:00:00 2001 +From a6e07dbd4c1958c76cb12211a8787c709a2b0f74 Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -7,10 +7,10 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index 44f6b90b4..74bdb6ea1 100644 +index 605b81179..4519cad0e 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2407,11 +2407,13 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, +@@ -2528,11 +2528,13 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, for (j = 0; j < wpa_s->last_scan_res_used; j++) { struct wpa_bss *bss = wpa_s->last_scan_res[j]; diff --git a/recipes-connectivity/hostapd/files/465-hostapd-config-support-random-BSS-color.patch b/recipes-connectivity/hostapd/files/465-hostapd-config-support-random-BSS-color.patch new file mode 100644 index 0000000..b05945c --- /dev/null +++ b/recipes-connectivity/hostapd/files/465-hostapd-config-support-random-BSS-color.patch @@ -0,0 +1,27 @@ +From 73289165d2871182af4ca7f95a099b53bef8e459 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Sat, 14 May 2022 21:41:03 +0200 +Subject: [PATCH] hostapd: config: support random BSS color + +Configure the HE BSS color to a random value in case the config defines +a BSS color which exceeds the max BSS color (63). + +Signed-off-by: David Bauer + +--- + hostapd/config_file.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 03b902076..bc988d0dd 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3485,6 +3485,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + } else if (os_strcmp(buf, "he_bss_color") == 0) { + conf->he_op.he_bss_color = atoi(pos) & 0x3f; + conf->he_op.he_bss_color_disabled = 0; ++ if (atoi(pos) > 63) ++ conf->he_op.he_bss_color = os_random() % 63 + 1; + } else if (os_strcmp(buf, "he_bss_color_partial") == 0) { + conf->he_op.he_bss_color_partial = atoi(pos); + } else if (os_strcmp(buf, "he_default_pe_duration") == 0) { diff --git a/recipes-connectivity/hostapd/files/470-survey_data_fallback.patch b/recipes-connectivity/hostapd/files/470-survey_data_fallback.patch index 6a6c38a..8f248ad 100644 --- a/recipes-connectivity/hostapd/files/470-survey_data_fallback.patch +++ b/recipes-connectivity/hostapd/files/470-survey_data_fallback.patch @@ -1,36 +1,16 @@ -From 89e0430eb616f09848a1811f1e40781c869c71fc Mon Sep 17 00:00:00 2001 +From 78ec7a84dd829e4dbc0bfd2d9c82d7c1a06467ef Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 --- - src/ap/acs.c | 13 +++---------- - 1 file changed, 3 insertions(+), 10 deletions(-) + src/ap/acs.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ap/acs.c b/src/ap/acs.c -index aa2ceb0d1..4993865b0 100644 +index faaedbfdb..a24e5410c 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c -@@ -302,18 +302,12 @@ static void acs_fail(struct hostapd_iface *iface) - 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 struct hostapd_channel_data *chan) +@@ -420,20 +420,19 @@ static int acs_usable_bw160_chan(const struct hostapd_channel_data *chan) static int acs_survey_is_sufficient(struct freq_survey *survey) { if (!(survey->filled & SURVEY_HAS_NF)) { diff --git a/recipes-connectivity/hostapd/files/500-lto-jobserver-support.patch b/recipes-connectivity/hostapd/files/500-lto-jobserver-support.patch index 74835f3..650237b 100644 --- a/recipes-connectivity/hostapd/files/500-lto-jobserver-support.patch +++ b/recipes-connectivity/hostapd/files/500-lto-jobserver-support.patch @@ -1,4 +1,4 @@ -From 413d20ed2ea266a86ec468705b7a3cba3a79666e Mon Sep 17 00:00:00 2001 +From 7220bb0ffbb1b6ed518f7b258e454bbd5b6fb75a Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 @@ -8,20 +8,21 @@ Date: Fri, 24 Jul 2020 14:41:09 +0200 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hostapd/Makefile b/hostapd/Makefile -index abd2acdc9..3f62d6844 100644 +index 6a125ed80..19a88e0fd 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -1327,14 +1327,14 @@ hostapd_multi.a: $(BCHECK) $(OBJS) +@@ -1307,7 +1307,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) @$(AR) cr $@ hostapd_multi.o $(OBJS) - hostapd: $(BCHECK) $(OBJS) + hostapd: $(OBJS) - $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) + +$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ ifdef CONFIG_WPA_TRACE - OBJS_c += ../src/utils/trace.o - endif +@@ -1318,7 +1318,7 @@ _OBJS_VAR := OBJS_c + include ../src/objs.mk + hostapd_cli: $(OBJS_c) - $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) + +$(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) @@ -29,10 +30,10 @@ index abd2acdc9..3f62d6844 100644 NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile -index 16ea58f4a..238e31b0c 100644 +index 57a89edcb..10f6da71c 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -1930,23 +1930,23 @@ wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs) +@@ -1949,31 +1949,31 @@ wpa_supplicant_multi.a: .config $(BCHECK) $(OBJS) $(EXTRA_progs) @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) @@ -40,21 +41,29 @@ index 16ea58f4a..238e31b0c 100644 + +$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_t + include ../src/objs.mk eapol_test: $(OBJS_t) - $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS) + +$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_t2 + include ../src/objs.mk preauth_test: $(OBJS_t2) - $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS) + +$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_p + include ../src/objs.mk wpa_passphrase: $(OBJS_p) - $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS) + +$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS) @$(E) " LD " $@ + _OBJS_VAR := OBJS_c + include ../src/objs.mk 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/recipes-connectivity/hostapd/files/590-rrm-wnm-statistics.patch b/recipes-connectivity/hostapd/files/590-rrm-wnm-statistics.patch new file mode 100644 index 0000000..2bd5d12 --- /dev/null +++ b/recipes-connectivity/hostapd/files/590-rrm-wnm-statistics.patch @@ -0,0 +1,108 @@ +From 4725c6a64dee96e3d3b7d906dfc9679d3f4a3190 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:28 +0000 + +--- + src/ap/hostapd.h | 18 ++++++++++++++++++ + src/ap/rrm.c | 2 ++ + src/ap/wnm_ap.c | 6 ++++++ + 3 files changed, 26 insertions(+) + +diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h +index cbe03a060..5d867f086 100644 +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h +@@ -150,6 +150,21 @@ struct hostapd_sae_commit_queue { + u8 msg[]; + }; + ++/** ++ * struct hostapd_openwrt_stats - OpenWrt custom STA/AP statistics ++ */ ++struct hostapd_openwrt_stats { ++ struct { ++ u64 neighbor_report_tx; ++ } rrm; ++ ++ struct { ++ u64 bss_transition_query_rx; ++ u64 bss_transition_request_tx; ++ u64 bss_transition_response_rx; ++ } wnm; ++}; ++ + /** + * struct hostapd_data - hostapd per-BSS data structure + */ +@@ -164,6 +179,9 @@ struct hostapd_data { + + u8 own_addr[ETH_ALEN]; + ++ /* OpenWrt specific statistics */ ++ struct hostapd_openwrt_stats openwrt_stats; ++ + int num_sta; /* number of entries in sta_list */ + struct sta_info *sta_list; /* STA info list head */ + #define STA_HASH_SIZE 256 +diff --git a/src/ap/rrm.c b/src/ap/rrm.c +index f2d5cd16e..1aa9aa89f 100644 +--- a/src/ap/rrm.c ++++ b/src/ap/rrm.c +@@ -269,6 +269,8 @@ static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, + } + } + ++ hapd->openwrt_stats.rrm.neighbor_report_tx++; ++ + hostapd_drv_send_action(hapd, hapd->iface->freq, 0, addr, + wpabuf_head(buf), wpabuf_len(buf)); + wpabuf_free(buf); +diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c +index 23a352c9b..fde743acc 100644 +--- a/src/ap/wnm_ap.c ++++ b/src/ap/wnm_ap.c +@@ -386,6 +386,7 @@ static int ieee802_11_send_bss_trans_mgmt_request(struct hostapd_data *hapd, + mgmt->u.action.u.bss_tm_req.validity_interval = 1; + pos = mgmt->u.action.u.bss_tm_req.variable; + ++ hapd->openwrt_stats.wnm.bss_transition_request_tx++; + wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to " + MACSTR " dialog_token=%u req_mode=0x%x disassoc_timer=%u " + "validity_interval=%u", +@@ -659,10 +660,12 @@ int ieee802_11_rx_wnm_action_ap(struct hostapd_data *hapd, + + switch (action) { + case WNM_BSS_TRANS_MGMT_QUERY: ++ hapd->openwrt_stats.wnm.bss_transition_query_rx++; + ieee802_11_rx_bss_trans_mgmt_query(hapd, mgmt->sa, payload, + plen); + return 0; + case WNM_BSS_TRANS_MGMT_RESP: ++ hapd->openwrt_stats.wnm.bss_transition_response_rx++; + ieee802_11_rx_bss_trans_mgmt_resp(hapd, mgmt->sa, payload, + plen); + return 0; +@@ -709,6 +712,7 @@ int wnm_send_disassoc_imminent(struct hostapd_data *hapd, + + pos = mgmt->u.action.u.bss_tm_req.variable; + ++ hapd->openwrt_stats.wnm.bss_transition_request_tx++; + wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request frame to indicate imminent disassociation (disassoc_timer=%d) to " + MACSTR, disassoc_timer, MAC2STR(sta->addr)); + if (hostapd_drv_send_mlme(hapd, buf, pos - buf, 0, NULL, 0, 0) < 0) { +@@ -790,6 +794,7 @@ int wnm_send_ess_disassoc_imminent(struct hostapd_data *hapd, + return -1; + } + ++ hapd->openwrt_stats.wnm.bss_transition_request_tx++; + if (disassoc_timer) { + /* send disassociation frame after time-out */ + set_disassoc_timer(hapd, sta, disassoc_timer); +@@ -870,6 +875,7 @@ int wnm_send_bss_tm_req(struct hostapd_data *hapd, struct sta_info *sta, + } + os_free(buf); + ++ hapd->openwrt_stats.wnm.bss_transition_request_tx++; + if (disassoc_timer) { + /* send disassociation frame after time-out */ + set_disassoc_timer(hapd, sta, disassoc_timer); diff --git a/recipes-connectivity/hostapd/files/599-wpa_supplicant-fix-warnings.patch b/recipes-connectivity/hostapd/files/599-wpa_supplicant-fix-warnings.patch index 3260184..a295194 100644 --- a/recipes-connectivity/hostapd/files/599-wpa_supplicant-fix-warnings.patch +++ b/recipes-connectivity/hostapd/files/599-wpa_supplicant-fix-warnings.patch @@ -1,4 +1,4 @@ -From a3e2b1f84e2a1bcf72fcc1b516296f9bce4616d5 Mon Sep 17 00:00:00 2001 +From 8b94367a604589d061f40f7e22b38bf59e702c9c Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Fri, 24 Jul 2020 14:41:09 +0200 diff --git a/recipes-connectivity/hostapd/files/610-hostapd_cli_ujail_permission.patch b/recipes-connectivity/hostapd/files/610-hostapd_cli_ujail_permission.patch new file mode 100644 index 0000000..1e5dfa4 --- /dev/null +++ b/recipes-connectivity/hostapd/files/610-hostapd_cli_ujail_permission.patch @@ -0,0 +1,43 @@ +From a1d6be648f6aa12d34bc4cfe8fb1c40ce4d1d427 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:28 +0000 + +--- + src/common/wpa_ctrl.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c +index 7e197f094..791fdbf93 100644 +--- a/src/common/wpa_ctrl.c ++++ b/src/common/wpa_ctrl.c +@@ -135,7 +135,7 @@ try_again: + return NULL; + } + tries++; +-#ifdef ANDROID ++ + /* Set client socket file permissions so that bind() creates the client + * socket with these permissions and there is no need to try to change + * them with chmod() after bind() which would have potential issues with +@@ -147,7 +147,7 @@ try_again: + * operations to allow the response to go through. Those are using the + * no-deference-symlinks version to avoid races. */ + fchmod(ctrl->s, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); +-#endif /* ANDROID */ ++ + if (bind(ctrl->s, (struct sockaddr *) &ctrl->local, + sizeof(ctrl->local)) < 0) { + if (errno == EADDRINUSE && tries < 2) { +@@ -165,7 +165,11 @@ try_again: + return NULL; + } + +-#ifdef ANDROID ++#ifndef ANDROID ++ /* Set group even if we do not have privileges to change owner */ ++ lchown(ctrl->local.sun_path, -1, 101); ++ lchown(ctrl->local.sun_path, 101, 101); ++#else + /* Set group even if we do not have privileges to change owner */ + lchown(ctrl->local.sun_path, -1, AID_WIFI); + lchown(ctrl->local.sun_path, AID_SYSTEM, AID_WIFI); diff --git a/recipes-connectivity/hostapd/files/700-wifi-reload.patch b/recipes-connectivity/hostapd/files/700-wifi-reload.patch index 0b6526e..d9805a1 100644 --- a/recipes-connectivity/hostapd/files/700-wifi-reload.patch +++ b/recipes-connectivity/hostapd/files/700-wifi-reload.patch @@ -1,24 +1,8 @@ -From 2e8209abe6fc9bd4e716596b9e82938e70cfba00 Mon Sep 17 00:00:00 2001 -From: Patrick Walther -Date: Fri, 24 Jul 2020 14:41:09 +0200 - ---- - hostapd/config_file.c | 4 ++++ - hostapd/ctrl_iface.c | 2 +- - hostapd/main.c | 2 +- - src/ap/ap_config.c | 2 ++ - src/ap/ap_config.h | 2 ++ - src/ap/hostapd.c | 41 ++++++++++++++++++++++++++++++++++++++--- - src/ap/hostapd.h | 5 +++-- - src/ap/wps_hostapd.c | 2 +- - src/drivers/driver_nl80211.c | 3 +++ - 9 files changed, 55 insertions(+), 8 deletions(-) - diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index ce0c62152..1631546d0 100644 +index bc988d0dd..67b385ded 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2501,6 +2501,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, +@@ -2412,6 +2412,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, bss->isolate = atoi(pos); } else if (os_strcmp(buf, "ap_max_inactivity") == 0) { bss->ap_max_inactivity = atoi(pos); @@ -27,7 +11,7 @@ index ce0c62152..1631546d0 100644 } else if (os_strcmp(buf, "skip_inactivity_poll") == 0) { bss->skip_inactivity_poll = atoi(pos); } else if (os_strcmp(buf, "country_code") == 0) { -@@ -3197,6 +3199,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, +@@ -3117,6 +3119,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, } } else if (os_strcmp(buf, "acs_exclude_dfs") == 0) { conf->acs_exclude_dfs = atoi(pos); @@ -37,10 +21,10 @@ index ce0c62152..1631546d0 100644 conf->op_class = atoi(pos); } else if (os_strcmp(buf, "channel") == 0) { diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index 13d7aba60..5b7f075b7 100644 +index 9215ab739..47183687f 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -184,7 +184,7 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt) +@@ -186,7 +186,7 @@ static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt) iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read; reload_opts = txt; @@ -50,7 +34,7 @@ index 13d7aba60..5b7f075b7 100644 iface->interfaces->config_read_cb = config_read_cb; } diff --git a/hostapd/main.c b/hostapd/main.c -index 9b44f4d41..62ee5642e 100644 +index 859ff3046..0d0e92e9e 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -317,7 +317,7 @@ static void handle_term(int sig, void *signal_ctx) @@ -63,10 +47,10 @@ index 9b44f4d41..62ee5642e 100644 "file - continuing with old."); } diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c -index 1c6b4a00e..602c0068f 100644 +index 1c229c6c7..23b67e139 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -780,6 +780,7 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf) +@@ -795,6 +795,7 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf) os_free(conf->radius_req_attr_sqlite); os_free(conf->rsn_preauth_interfaces); os_free(conf->ctrl_interface); @@ -74,7 +58,7 @@ index 1c6b4a00e..602c0068f 100644 os_free(conf->ca_cert); os_free(conf->server_cert); os_free(conf->server_cert2); -@@ -972,6 +973,7 @@ void hostapd_config_free(struct hostapd_config *conf) +@@ -992,6 +993,7 @@ void hostapd_config_free(struct hostapd_config *conf) for (i = 0; i < conf->num_bss; i++) hostapd_config_free_bss(conf->bss[i]); @@ -83,30 +67,31 @@ index 1c6b4a00e..602c0068f 100644 os_free(conf->supported_rates); os_free(conf->basic_rates); diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 319e8c108..37ace8fb9 100644 +index 58dd2cfed..e4340952e 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -871,6 +871,7 @@ struct hostapd_bss_config { - */ - u8 mka_psk_set; - #endif /* CONFIG_MACSEC */ -+ char *config_id; - }; +@@ -285,6 +285,8 @@ struct hostapd_bss_config { + char vlan_bridge[IFNAMSIZ + 1]; + char wds_bridge[IFNAMSIZ + 1]; - /** -@@ -1062,6 +1063,7 @@ struct hostapd_config { - unsigned int airtime_update_interval; - #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1) - #endif /* CONFIG_AIRTIME_POLICY */ ++ char *config_id; ++ + enum hostapd_logger_level logger_syslog_level, logger_stdout_level; + + unsigned int logger_syslog; /* module bitfield */ +@@ -966,6 +968,7 @@ struct eht_phy_capabilities_info { + struct hostapd_config { + struct hostapd_bss_config **bss, *last_bss; + size_t num_bss; + char *config_id; - u8 notify_mgmt_frames; - }; + u16 beacon_int; + int rts_threshold; diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index 3629f54ad..5b23208f6 100644 +index f6c9c0e78..5d3a6de42 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -218,6 +218,10 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf, +@@ -224,6 +224,10 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf, { size_t i; @@ -117,7 +102,7 @@ index 3629f54ad..5b23208f6 100644 if (newconf->num_bss != oldconf->num_bss) return 1; -@@ -231,7 +235,7 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf, +@@ -237,7 +241,7 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf, } @@ -126,7 +111,7 @@ index 3629f54ad..5b23208f6 100644 { struct hapd_interfaces *interfaces = iface->interfaces; struct hostapd_data *hapd = iface->bss[0]; -@@ -254,13 +258,16 @@ int hostapd_reload_config(struct hostapd_iface *iface) +@@ -260,13 +264,15 @@ int hostapd_reload_config(struct hostapd_iface *iface) if (newconf == NULL) return -1; @@ -139,13 +124,12 @@ index 3629f54ad..5b23208f6 100644 + if (reconf) + return -1; -+ + hostapd_clear_old(iface); + wpa_printf(MSG_DEBUG, "Configuration changes include interface/BSS modification - force full disable+enable sequence"); fname = os_strdup(iface->config_fname); -@@ -285,6 +292,24 @@ int hostapd_reload_config(struct hostapd_iface *iface) +@@ -291,6 +297,24 @@ int hostapd_reload_config(struct hostapd_iface *iface) wpa_printf(MSG_ERROR, "Failed to enable interface on config reload"); return res; @@ -154,14 +138,14 @@ index 3629f54ad..5b23208f6 100644 + hapd = iface->bss[j]; + if (!hapd->config_id || strcmp(hapd->config_id, newconf->bss[j]->config_id)) { + hostapd_flush_old_stations(iface->bss[j], -+ WLAN_REASON_PREV_AUTH_NOT_VALID); ++ WLAN_REASON_PREV_AUTH_NOT_VALID); +#ifdef CONFIG_WEP + hostapd_broadcast_wep_clear(iface->bss[j]); +#endif + +#ifndef CONFIG_NO_RADIUS + /* TODO: update dynamic data based on changed configuration -+ * items (e.g., open/close sockets, etc.) */ ++ * items (e.g., open/close sockets, etc.) */ + radius_client_flush(iface->bss[j]->radius, 0); +#endif /* CONFIG_NO_RADIUS */ + wpa_printf(MSG_INFO, "bss %zu changed", j); @@ -170,7 +154,7 @@ index 3629f54ad..5b23208f6 100644 } iface->conf = newconf; -@@ -301,6 +326,12 @@ int hostapd_reload_config(struct hostapd_iface *iface) +@@ -307,6 +331,12 @@ int hostapd_reload_config(struct hostapd_iface *iface) for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; @@ -183,7 +167,7 @@ index 3629f54ad..5b23208f6 100644 hapd->iconf = newconf; hapd->conf = newconf->bss[j]; hostapd_reload_bss(hapd); -@@ -2361,6 +2392,10 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, +@@ -2415,6 +2445,10 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, hapd->iconf = conf; hapd->conf = bss; hapd->iface = hapd_iface; @@ -195,10 +179,10 @@ index 3629f54ad..5b23208f6 100644 hapd->driver = conf->driver; hapd->ctrl_sock = -1; diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h -index 4ce31416d..8412ec226 100644 +index 5d867f086..ae8d305aa 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -45,7 +45,7 @@ struct mesh_conf; +@@ -46,7 +46,7 @@ struct mesh_conf; struct hostapd_iface; struct hapd_interfaces { @@ -207,7 +191,7 @@ index 4ce31416d..8412ec226 100644 struct hostapd_config * (*config_read_cb)(const char *config_fname); int (*ctrl_iface_init)(struct hostapd_data *hapd); void (*ctrl_iface_deinit)(struct hostapd_data *hapd); -@@ -154,6 +154,7 @@ struct hostapd_data { +@@ -172,6 +172,7 @@ struct hostapd_data { struct hostapd_iface *iface; struct hostapd_config *iconf; struct hostapd_bss_config *conf; @@ -215,7 +199,7 @@ index 4ce31416d..8412ec226 100644 int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -598,7 +599,7 @@ struct hostapd_iface { +@@ -652,7 +653,7 @@ struct hostapd_iface { int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx); @@ -225,7 +209,7 @@ index 4ce31416d..8412ec226 100644 struct hostapd_data * hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c -index 18925f0c3..e71960569 100644 +index 0c351af5f..e4f303bdc 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -315,7 +315,7 @@ static void wps_reload_config(void *eloop_data, void *user_ctx) @@ -238,10 +222,10 @@ index 18925f0c3..e71960569 100644 "configuration"); } diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 948f3c6fa..ffeb116ef 100644 +index 69afdabbc..a0019c3e3 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4511,6 +4511,9 @@ static int wpa_driver_nl80211_set_ap(void *priv, +@@ -4844,6 +4844,9 @@ static int wpa_driver_nl80211_set_ap(void *priv, if (ret) { wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)", ret, strerror(-ret)); diff --git a/recipes-connectivity/hostapd/files/710-vlan_no_bridge.patch b/recipes-connectivity/hostapd/files/710-vlan_no_bridge.patch new file mode 100644 index 0000000..c08fc88 --- /dev/null +++ b/recipes-connectivity/hostapd/files/710-vlan_no_bridge.patch @@ -0,0 +1,57 @@ +From d8aa8cfd9e47a553bd8f20b8fa20eed153d76704 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:28 +0000 + +--- + hostapd/config_file.c | 2 ++ + src/ap/ap_config.h | 1 + + src/ap/vlan_full.c | 4 ++++ + 3 files changed, 7 insertions(+) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 67b385ded..7fcbb0be3 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3342,6 +3342,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + #ifndef CONFIG_NO_VLAN + } else if (os_strcmp(buf, "dynamic_vlan") == 0) { + bss->ssid.dynamic_vlan = atoi(pos); ++ } else if (os_strcmp(buf, "vlan_no_bridge") == 0) { ++ bss->ssid.vlan_no_bridge = atoi(pos); + } else if (os_strcmp(buf, "per_sta_vif") == 0) { + bss->ssid.per_sta_vif = atoi(pos); + } else if (os_strcmp(buf, "vlan_file") == 0) { +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index e4340952e..6884d30be 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -121,6 +121,7 @@ struct hostapd_ssid { + #define DYNAMIC_VLAN_OPTIONAL 1 + #define DYNAMIC_VLAN_REQUIRED 2 + int dynamic_vlan; ++ int vlan_no_bridge; + #define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0 + #define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1 + #define DYNAMIC_VLAN_NAMING_END 2 +diff --git a/src/ap/vlan_full.c b/src/ap/vlan_full.c +index 19aa3c649..053d6338e 100644 +--- a/src/ap/vlan_full.c ++++ b/src/ap/vlan_full.c +@@ -475,6 +475,9 @@ void vlan_newlink(const char *ifname, struct hostapd_data *hapd) + if (!vlan) + return; + ++ if (hapd->conf->ssid.vlan_no_bridge) ++ goto out; ++ + vlan->configured = 1; + + notempty = vlan->vlan_desc.notempty; +@@ -506,6 +509,7 @@ void vlan_newlink(const char *ifname, struct hostapd_data *hapd) + ifname, br_name, tagged[i], hapd); + } + ++out: + ifconfig_up(ifname); + } + diff --git a/recipes-connectivity/hostapd/files/711-wds_bridge_force.patch b/recipes-connectivity/hostapd/files/711-wds_bridge_force.patch new file mode 100644 index 0000000..9a1d3f0 --- /dev/null +++ b/recipes-connectivity/hostapd/files/711-wds_bridge_force.patch @@ -0,0 +1,35 @@ +From 5a171ddcfab8d1a51e17e73e322d194c99d12092 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:29 +0000 + +--- + hostapd/config_file.c | 2 ++ + src/ap/ap_drv_ops.c | 2 -- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 7fcbb0be3..24f044ae2 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -2312,6 +2312,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + sizeof(conf->bss[0]->iface)); + } else if (os_strcmp(buf, "bridge") == 0) { + os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); ++ if (!bss->wds_bridge[0]) ++ os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); + } else if (os_strcmp(buf, "vlan_bridge") == 0) { + os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge)); + } else if (os_strcmp(buf, "wds_bridge") == 0) { +diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c +index 8af7a0e25..192b30ce1 100644 +--- a/src/ap/ap_drv_ops.c ++++ b/src/ap/ap_drv_ops.c +@@ -340,8 +340,6 @@ int hostapd_set_wds_sta(struct hostapd_data *hapd, char *ifname_wds, + return -1; + if (hapd->conf->wds_bridge[0]) + bridge = hapd->conf->wds_bridge; +- else if (hapd->conf->bridge[0]) +- bridge = hapd->conf->bridge; + return hapd->driver->set_wds_sta(hapd->drv_priv, addr, aid, val, + bridge, ifname_wds); + } diff --git a/recipes-connectivity/hostapd/files/720-iface_max_num_sta.patch b/recipes-connectivity/hostapd/files/720-iface_max_num_sta.patch new file mode 100644 index 0000000..ea77c97 --- /dev/null +++ b/recipes-connectivity/hostapd/files/720-iface_max_num_sta.patch @@ -0,0 +1,104 @@ +From 0682b469685046b6f963c97edf0c72df4e3728b6 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:29 +0000 + +--- + hostapd/config_file.c | 8 ++++++++ + src/ap/ap_config.h | 2 ++ + src/ap/beacon.c | 2 +- + src/ap/hostapd.c | 24 ++++++++++++++++++++++++ + src/ap/hostapd.h | 1 + + 5 files changed, 36 insertions(+), 1 deletion(-) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 24f044ae2..a7b7b91ae 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -2837,6 +2837,14 @@ static int hostapd_config_fill(struct hostapd_config *conf, + line, bss->max_num_sta, MAX_STA_COUNT); + return 1; + } ++ } else if (os_strcmp(buf, "iface_max_num_sta") == 0) { ++ conf->max_num_sta = atoi(pos); ++ if (conf->max_num_sta < 0 || ++ conf->max_num_sta > MAX_STA_COUNT) { ++ wpa_printf(MSG_ERROR, "Line %d: Invalid max_num_sta=%d; allowed range 0..%d", ++ line, conf->max_num_sta, MAX_STA_COUNT); ++ return 1; ++ } + } else if (os_strcmp(buf, "wpa") == 0) { + bss->wpa = atoi(pos); + } else if (os_strcmp(buf, "extended_key_id") == 0) { +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index 6884d30be..5c466d529 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1007,6 +1007,8 @@ struct hostapd_config { + unsigned int track_sta_max_num; + unsigned int track_sta_max_age; + ++ int max_num_sta; ++ + char country[3]; /* first two octets: country code as described in + * ISO/IEC 3166-1. Third octet: + * ' ' (ascii 32): all environments +diff --git a/src/ap/beacon.c b/src/ap/beacon.c +index 7c9b589e0..4e02739e5 100644 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1135,7 +1135,7 @@ void handle_probe_req(struct hostapd_data *hapd, + if (hapd->conf->no_probe_resp_if_max_sta && + is_multicast_ether_addr(mgmt->da) && + is_multicast_ether_addr(mgmt->bssid) && +- hapd->num_sta >= hapd->conf->max_num_sta && ++ hostapd_check_max_sta(hapd) && + !ap_get_sta(hapd, mgmt->sa)) { + wpa_printf(MSG_MSGDUMP, "%s: Ignore Probe Request from " MACSTR + " since no room for additional STA", +diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c +index 72ab76e93..377436263 100644 +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -241,6 +241,30 @@ static int hostapd_iface_conf_changed(struct hostapd_config *newconf, + } + + ++static inline int hostapd_iface_num_sta(struct hostapd_iface *iface) ++{ ++ int num_sta = 0; ++ int i; ++ ++ for (i = 0; i < iface->num_bss; i++) ++ num_sta += iface->bss[i]->num_sta; ++ ++ return num_sta; ++} ++ ++ ++int hostapd_check_max_sta(struct hostapd_data *hapd) ++{ ++ if (hapd->num_sta >= hapd->conf->max_num_sta) ++ return 1; ++ ++ if (hapd->iconf->max_num_sta && ++ hostapd_iface_num_sta(hapd->iface) >= hapd->iconf->max_num_sta) ++ return 1; ++ ++ return 0; ++} ++ + int hostapd_reload_config(struct hostapd_iface *iface, int reconf) + { + struct hapd_interfaces *interfaces = iface->interfaces; +diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h +index 0c1bca809..0e588ce91 100644 +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h +@@ -698,6 +698,7 @@ void hostapd_cleanup_cs_params(struct hostapd_data *hapd); + 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); ++int hostapd_check_max_sta(struct hostapd_data *hapd); + + void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap); + void hostapd_cleanup_cca_params(struct hostapd_data *hapd); diff --git a/recipes-connectivity/hostapd/files/730-ft_iface.patch b/recipes-connectivity/hostapd/files/730-ft_iface.patch new file mode 100644 index 0000000..b017214 --- /dev/null +++ b/recipes-connectivity/hostapd/files/730-ft_iface.patch @@ -0,0 +1,54 @@ +From 5326cc72099d17c8b4746e2d5c04f70805d42ccd Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:29 +0000 + +--- + hostapd/config_file.c | 2 ++ + src/ap/ap_config.h | 1 + + src/ap/wpa_auth_glue.c | 8 ++++++-- + 3 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index a7b7b91ae..62eaab122 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -2996,6 +2996,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + wpa_printf(MSG_INFO, + "Line %d: Obsolete peerkey parameter ignored", line); + #ifdef CONFIG_IEEE80211R_AP ++ } else if (os_strcmp(buf, "ft_iface") == 0) { ++ os_strlcpy(bss->ft_iface, pos, sizeof(bss->ft_iface)); + } else if (os_strcmp(buf, "mobility_domain") == 0) { + if (os_strlen(pos) != 2 * MOBILITY_DOMAIN_ID_LEN || + hexstr2bin(pos, bss->mobility_domain, +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index 5c466d529..f0ec2fe6a 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -283,6 +283,7 @@ struct airtime_sta_weight { + struct hostapd_bss_config { + char iface[IFNAMSIZ + 1]; + char bridge[IFNAMSIZ + 1]; ++ char ft_iface[IFNAMSIZ + 1]; + char vlan_bridge[IFNAMSIZ + 1]; + char wds_bridge[IFNAMSIZ + 1]; + +diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c +index 5c7075891..e5a9a7b35 100644 +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c +@@ -1593,8 +1593,12 @@ int hostapd_setup_wpa(struct hostapd_data *hapd) + wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) { + const char *ft_iface; + +- ft_iface = hapd->conf->bridge[0] ? hapd->conf->bridge : +- hapd->conf->iface; ++ if (hapd->conf->ft_iface[0]) ++ ft_iface = hapd->conf->ft_iface; ++ else if (hapd->conf->bridge[0]) ++ ft_iface = hapd->conf->bridge; ++ else ++ ft_iface = hapd->conf->iface; + hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB, + hostapd_rrb_receive, hapd, 1); + if (!hapd->l2) { diff --git a/recipes-connectivity/hostapd/files/740-snoop_iface.patch b/recipes-connectivity/hostapd/files/740-snoop_iface.patch new file mode 100644 index 0000000..efcb4ab --- /dev/null +++ b/recipes-connectivity/hostapd/files/740-snoop_iface.patch @@ -0,0 +1,82 @@ +From 86704eeb96106bf9a2d5fdd09b044dca92f719f7 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:29 +0000 + +--- + hostapd/config_file.c | 2 ++ + src/ap/ap_config.h | 1 + + src/ap/x_snoop.c | 15 +++++++++++---- + 3 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 62eaab122..7af9f7a72 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -2314,6 +2314,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, + os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); + if (!bss->wds_bridge[0]) + os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); ++ } else if (os_strcmp(buf, "snoop_iface") == 0) { ++ os_strlcpy(bss->snoop_iface, pos, sizeof(bss->snoop_iface)); + } else if (os_strcmp(buf, "vlan_bridge") == 0) { + os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge)); + } else if (os_strcmp(buf, "wds_bridge") == 0) { +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index f0ec2fe6a..f795ee919 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -284,6 +284,7 @@ struct hostapd_bss_config { + char iface[IFNAMSIZ + 1]; + char bridge[IFNAMSIZ + 1]; + char ft_iface[IFNAMSIZ + 1]; ++ char snoop_iface[IFNAMSIZ + 1]; + char vlan_bridge[IFNAMSIZ + 1]; + char wds_bridge[IFNAMSIZ + 1]; + +diff --git a/src/ap/x_snoop.c b/src/ap/x_snoop.c +index 029f4de23..30c990fd2 100644 +--- a/src/ap/x_snoop.c ++++ b/src/ap/x_snoop.c +@@ -33,14 +33,16 @@ int x_snoop_init(struct hostapd_data *hapd) + + hapd->x_snoop_initialized = true; + +- if (hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE, ++ if (!conf->snoop_iface[0] && ++ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE, + 1)) { + wpa_printf(MSG_DEBUG, + "x_snoop: Failed to enable hairpin_mode on the bridge port"); + return -1; + } + +- if (hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_PROXYARP, 1)) { ++ if (!conf->snoop_iface[0] && ++ hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_PROXYARP, 1)) { + wpa_printf(MSG_DEBUG, + "x_snoop: Failed to enable proxyarp on the bridge port"); + return -1; +@@ -54,7 +56,8 @@ int x_snoop_init(struct hostapd_data *hapd) + } + + #ifdef CONFIG_IPV6 +- if (hostapd_drv_br_set_net_param(hapd, DRV_BR_MULTICAST_SNOOPING, 1)) { ++ if (!conf->snoop_iface[0] && ++ hostapd_drv_br_set_net_param(hapd, DRV_BR_MULTICAST_SNOOPING, 1)) { + wpa_printf(MSG_DEBUG, + "x_snoop: Failed to enable multicast snooping on the bridge"); + return -1; +@@ -73,8 +76,12 @@ x_snoop_get_l2_packet(struct hostapd_data *hapd, + { + struct hostapd_bss_config *conf = hapd->conf; + struct l2_packet_data *l2; ++ const char *ifname = conf->bridge; + +- l2 = l2_packet_init(conf->bridge, NULL, ETH_P_ALL, handler, hapd, 1); ++ if (conf->snoop_iface[0]) ++ ifname = conf->snoop_iface; ++ ++ l2 = l2_packet_init(ifname, NULL, ETH_P_ALL, handler, hapd, 1); + if (l2 == NULL) { + wpa_printf(MSG_DEBUG, + "x_snoop: Failed to initialize L2 packet processing %s", diff --git a/recipes-connectivity/hostapd/files/750-qos_map_set_without_interworking.patch b/recipes-connectivity/hostapd/files/750-qos_map_set_without_interworking.patch new file mode 100644 index 0000000..cba6380 --- /dev/null +++ b/recipes-connectivity/hostapd/files/750-qos_map_set_without_interworking.patch @@ -0,0 +1,116 @@ +From 9279da2d91d4c8c4a33449e0a6fe0f03e91a40e5 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:29 +0000 + +--- + hostapd/config_file.c | 6 +++--- + src/ap/hostapd.c | 2 +- + src/ap/ieee802_11_shared.c | 2 -- + wpa_supplicant/events.c | 6 ------ + 4 files changed, 4 insertions(+), 12 deletions(-) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 7af9f7a72..e57c78b70 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -1598,6 +1598,8 @@ static int parse_anqp_elem(struct hostapd_bss_config *bss, char *buf, int line) + return 0; + } + ++#endif /* CONFIG_INTERWORKING */ ++ + + static int parse_qos_map_set(struct hostapd_bss_config *bss, + char *buf, int line) +@@ -1639,8 +1641,6 @@ static int parse_qos_map_set(struct hostapd_bss_config *bss, + return 0; + } + +-#endif /* CONFIG_INTERWORKING */ +- + + #ifdef CONFIG_HS20 + static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, +@@ -4042,10 +4042,10 @@ static int hostapd_config_fill(struct hostapd_config *conf, + bss->gas_frag_limit = val; + } else if (os_strcmp(buf, "gas_comeback_delay") == 0) { + bss->gas_comeback_delay = atoi(pos); ++#endif /* CONFIG_INTERWORKING */ + } else if (os_strcmp(buf, "qos_map_set") == 0) { + if (parse_qos_map_set(bss, pos, line) < 0) + return 1; +-#endif /* CONFIG_INTERWORKING */ + #ifdef CONFIG_RADIUS_TEST + } else if (os_strcmp(buf, "dump_msk_file") == 0) { + os_free(bss->dump_msk_file); +diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c +index 377436263..e61ac39b8 100644 +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -1424,6 +1424,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) + wpa_printf(MSG_ERROR, "GAS server initialization failed"); + return -1; + } ++#endif /* CONFIG_INTERWORKING */ + + if (conf->qos_map_set_len && + hostapd_drv_set_qos_map(hapd, conf->qos_map_set, +@@ -1431,7 +1432,6 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) + wpa_printf(MSG_ERROR, "Failed to initialize QoS Map"); + return -1; + } +-#endif /* CONFIG_INTERWORKING */ + + if (conf->bss_load_update_period && bss_load_update_init(hapd)) { + wpa_printf(MSG_ERROR, "BSS Load initialization failed"); +diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c +index 615489511..691b1394a 100644 +--- a/src/ap/ieee802_11_shared.c ++++ b/src/ap/ieee802_11_shared.c +@@ -1098,13 +1098,11 @@ u8 * hostapd_eid_rsnxe(struct hostapd_data *hapd, u8 *eid, size_t len) + u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta, + const u8 *ext_capab_ie, size_t ext_capab_ie_len) + { +-#ifdef CONFIG_INTERWORKING + /* check for QoS Map support */ + if (ext_capab_ie_len >= 5) { + if (ext_capab_ie[4] & 0x01) + sta->qos_map_enabled = 1; + } +-#endif /* CONFIG_INTERWORKING */ + + if (ext_capab_ie_len > 0) { + sta->ecsa_supported = !!(ext_capab_ie[0] & BIT(2)); +diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c +index 86a0dc7fa..0bac5f2c2 100644 +--- a/wpa_supplicant/events.c ++++ b/wpa_supplicant/events.c +@@ -2586,8 +2586,6 @@ void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s) + } + + +-#ifdef CONFIG_INTERWORKING +- + static int wpas_qos_map_set(struct wpa_supplicant *wpa_s, const u8 *qos_map, + size_t len) + { +@@ -2620,8 +2618,6 @@ static void interworking_process_assoc_resp(struct wpa_supplicant *wpa_s, + } + } + +-#endif /* CONFIG_INTERWORKING */ +- + + static void multi_ap_process_assoc_resp(struct wpa_supplicant *wpa_s, + const u8 *ies, size_t ies_len) +@@ -2954,10 +2950,8 @@ static int wpa_supplicant_event_associnfo(struct wpa_supplicant *wpa_s, + wnm_process_assoc_resp(wpa_s, data->assoc_info.resp_ies, + data->assoc_info.resp_ies_len); + #endif /* CONFIG_WNM */ +-#ifdef CONFIG_INTERWORKING + interworking_process_assoc_resp(wpa_s, data->assoc_info.resp_ies, + data->assoc_info.resp_ies_len); +-#endif /* CONFIG_INTERWORKING */ + if (wpa_s->hw_capab == CAPAB_VHT && + get_ie(data->assoc_info.resp_ies, + data->assoc_info.resp_ies_len, WLAN_EID_VHT_CAP)) diff --git a/recipes-connectivity/hostapd/files/751-qos_map_ignore_when_unsupported.patch b/recipes-connectivity/hostapd/files/751-qos_map_ignore_when_unsupported.patch new file mode 100644 index 0000000..96cda9e --- /dev/null +++ b/recipes-connectivity/hostapd/files/751-qos_map_ignore_when_unsupported.patch @@ -0,0 +1,22 @@ +From 898a6cd8ef1eefa3c214d0b558959a4f52084706 Mon Sep 17 00:00:00 2001 +From: OpenEmbedded +Date: Thu, 15 Sep 2022 12:35:29 +0000 + +--- + src/ap/ap_drv_ops.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c +index 192b30ce1..f7ad3edc7 100644 +--- a/src/ap/ap_drv_ops.c ++++ b/src/ap/ap_drv_ops.c +@@ -864,7 +864,8 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface, + int hostapd_drv_set_qos_map(struct hostapd_data *hapd, + const u8 *qos_map_set, u8 qos_map_set_len) + { +- if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv) ++ if (!hapd->driver || !hapd->driver->set_qos_map || !hapd->drv_priv || ++ !(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_QOS_MAPPING)) + return 0; + return hapd->driver->set_qos_map(hapd->drv_priv, qos_map_set, + qos_map_set_len); diff --git a/recipes-connectivity/hostapd/files/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch b/recipes-connectivity/hostapd/files/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch deleted file mode 100644 index 6c37a14..0000000 --- a/recipes-connectivity/hostapd/files/800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 45e2411ad553ed6a89fb2c4f9058e27de91c689d Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Fri, 3 Jul 2020 23:00:34 +0200 -Subject: [PATCH] dfs: enter DFS state if no available channel is found - -Previously hostapd would not stop transmitting when a DFS event was -detected and no available channel to switch to was available. - -Disable and re-enable the interface to enter DFS state. This way, TX -does not happen until the kernel notifies hostapd about the NOP -expiring. - -Signed-off-by: David Bauer - ---- - src/ap/dfs.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/src/ap/dfs.c b/src/ap/dfs.c -index 8f3630bf8..54a61b0a7 100644 ---- a/src/ap/dfs.c -+++ b/src/ap/dfs.c -@@ -1086,8 +1086,15 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) - &oper_centr_freq_seg0_idx, - &oper_centr_freq_seg1_idx, - &skip_radar); -- if (!channel) -- return err; -+ if (!channel) { -+ /* -+ * Toggle interface state to enter DFS state -+ * until NOP is finished. -+ */ -+ hostapd_disable_iface(iface); -+ hostapd_enable_iface(iface); -+ return 0; -+ } - if (!skip_radar) { - iface->freq = channel->freq; - iface->conf->channel = channel->chan; diff --git a/recipes-connectivity/hostapd/files/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch b/recipes-connectivity/hostapd/files/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch deleted file mode 100644 index 58c202d..0000000 --- a/recipes-connectivity/hostapd/files/801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch +++ /dev/null @@ -1,36 +0,0 @@ -From a753b7dad5275637b214a7de5c8de451586f7050 Mon Sep 17 00:00:00 2001 -From: Jouni Malinen -Date: Mon, 9 Nov 2020 11:43:12 +0200 -Subject: [PATCH] P2P: Fix copying of secondary device types for P2P group - client - -Parsing and copying of WPS secondary device types list was verifying -that the contents is not too long for the internal maximum in the case -of WPS messages, but similar validation was missing from the case of P2P -group information which encodes this information in a different -attribute. This could result in writing beyond the memory area assigned -for these entries and corrupting memory within an instance of struct -p2p_device. This could result in invalid operations and unexpected -behavior when trying to free pointers from that corrupted memory. - -Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27269 -Fixes: e57ae6e19edf ("P2P: Keep track of secondary device types for peers") -Signed-off-by: Jouni Malinen - ---- - src/p2p/p2p.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c -index b7a5eae35..498ff54f8 100644 ---- a/src/p2p/p2p.c -+++ b/src/p2p/p2p.c -@@ -453,6 +453,8 @@ static void p2p_copy_client_info(struct p2p_device *dev, - dev->info.config_methods = cli->config_methods; - os_memcpy(dev->info.pri_dev_type, cli->pri_dev_type, 8); - dev->info.wps_sec_dev_type_list_len = 8 * cli->num_sec_dev_types; -+ if (dev->info.wps_sec_dev_type_list_len > WPS_SEC_DEV_TYPE_MAX_LEN) -+ dev->info.wps_sec_dev_type_list_len = WPS_SEC_DEV_TYPE_MAX_LEN; - os_memcpy(dev->info.wps_sec_dev_type_list, cli->sec_dev_types, - dev->info.wps_sec_dev_type_list_len); - } diff --git a/recipes-connectivity/hostapd/files/910-wpa_supplicant_remove_acl.patch b/recipes-connectivity/hostapd/files/910-wpa_supplicant_remove_acl.patch new file mode 100644 index 0000000..0f88973 --- /dev/null +++ b/recipes-connectivity/hostapd/files/910-wpa_supplicant_remove_acl.patch @@ -0,0 +1,42 @@ +diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c +index 992c0a056..d0cc641e5 100644 +--- a/wpa_supplicant/ap.c ++++ b/wpa_supplicant/ap.c +@@ -1613,7 +1613,7 @@ int ap_ctrl_iface_bss_tm_req(struct wpa_supplicant *wpa_s, const char *buf) + + #endif /* CONFIG_WNM_AP */ + +- ++#ifdef CONFIG_CTRL_IFACE_ACL + int ap_ctrl_iface_acl_add_mac(struct wpa_supplicant *wpa_s, + enum macaddr_acl acl_type, + const char *buf) +@@ -1748,7 +1748,7 @@ int ap_ctrl_iface_set_acl(struct wpa_supplicant *wpa_s) + + return hostapd_set_acl(hapd); + } +- ++#endif /* CONFIG_CTRL_IFACE_ACL */ + #endif /* CONFIG_CTRL_IFACE */ + + +diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c +index bb6b1f9ac..6016e843e 100644 +--- a/wpa_supplicant/ctrl_iface.c ++++ b/wpa_supplicant/ctrl_iface.c +@@ -12050,6 +12050,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, + } else if (os_strcmp(buf, "UPDATE_BEACON") == 0) { + if (wpas_ap_update_beacon(wpa_s)) + reply_len = -1; ++#ifdef CONFIG_CTRL_IFACE_ACL + } else if (os_strncmp(buf, "ACCEPT_ACL ", 11) == 0) { + if (os_strncmp(buf + 11, "ADD_MAC ", 8) == 0) { + if (ap_ctrl_iface_acl_add_mac(wpa_s, +@@ -12102,6 +12103,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, + } else { + reply_len = -1; + } ++#endif + #endif /* CONFIG_AP */ + } else if (os_strcmp(buf, "SUSPEND") == 0) { + wpas_notify_suspend(wpa_s->global); diff --git a/recipes-connectivity/hostapd/files/912-iapp-integration.patch b/recipes-connectivity/hostapd/files/912-iapp-integration.patch index 697f403..6567dac 100644 --- a/recipes-connectivity/hostapd/files/912-iapp-integration.patch +++ b/recipes-connectivity/hostapd/files/912-iapp-integration.patch @@ -1,38 +1,8 @@ -From 59998a2c8a98b390ed94fef09ca657d9c755bd58 Mon Sep 17 00:00:00 2001 -From: Patrick Walther -Date: Tue, 23 Mar 2021 16:00:24 +0100 -Subject: [PATCH] commit 61e4fb918e299376d4f0a53485b74560f168eb52 - - Revert "Remove IAPP functionality from hostapd" - - This reverts commit 018edec9b2bd3db20605117c32ff79c1e625c432. - ---- - hostapd/Android.mk | 5 + - hostapd/Makefile | 5 + - hostapd/android.config | 3 + - hostapd/config_file.c | 3 +- - hostapd/defconfig | 3 + - hostapd/hostapd.conf | 6 + - hostapd/main.c | 3 + - src/ap/Makefile | 2 + - src/ap/ap_config.h | 4 + - src/ap/hostapd.c | 14 + - src/ap/hostapd.h | 2 + - src/ap/iapp.c | 542 ++++++++++++++++++++++++++++++ - src/ap/iapp.h | 39 +++ - src/utils/wpa_debug.h | 1 + - tests/build/build-hostapd-internal.config | 1 + - tests/hwsim/example-hostapd.config | 1 + - 16 files changed, 633 insertions(+), 1 deletion(-) - create mode 100644 src/ap/iapp.c - create mode 100644 src/ap/iapp.h - diff --git a/hostapd/Android.mk b/hostapd/Android.mk -index 6cfbe5c22..bb96db8c0 100644 +index 2f8e8862e..21708132c 100644 --- a/hostapd/Android.mk +++ b/hostapd/Android.mk -@@ -206,6 +206,11 @@ endif +@@ -210,6 +210,11 @@ endif L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX @@ -45,10 +15,10 @@ index 6cfbe5c22..bb96db8c0 100644 L_CFLAGS += -DCONFIG_RSN_PREAUTH CONFIG_L2_PACKET=y diff --git a/hostapd/Makefile b/hostapd/Makefile -index 3f62d6844..e227a8807 100644 +index 19a88e0fd..64c29ef33 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -259,6 +259,11 @@ ifndef CONFIG_NO_CTRL_IFACE +@@ -254,6 +254,11 @@ ifndef CONFIG_NO_CTRL_IFACE CFLAGS += -DCONFIG_CTRL_IFACE endif @@ -61,10 +31,10 @@ index 3f62d6844..e227a8807 100644 CFLAGS += -DCONFIG_RSN_PREAUTH CONFIG_L2_PACKET=y diff --git a/hostapd/android.config b/hostapd/android.config -index 94a9bb47b..eada5b2f6 100644 +index c8b3afabe..095f930da 100644 --- a/hostapd/android.config +++ b/hostapd/android.config -@@ -38,6 +38,9 @@ CONFIG_DRIVER_NL80211_QCA=y +@@ -41,6 +41,9 @@ CONFIG_DRIVER_NL80211_QCA=y # Driver interface for no driver (e.g., RADIUS server only) #CONFIG_DRIVER_NONE=y @@ -75,10 +45,10 @@ index 94a9bb47b..eada5b2f6 100644 #CONFIG_RSN_PREAUTH=y diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 1631546d0..9ae56ffff 100644 +index e57c78b70..a388703fb 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2756,7 +2756,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, +@@ -2675,7 +2675,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, bss->eapol_key_index_workaround = atoi(pos); #ifdef CONFIG_IAPP } else if (os_strcmp(buf, "iapp_interface") == 0) { @@ -89,7 +59,7 @@ index 1631546d0..9ae56ffff 100644 } else if (os_strcmp(buf, "own_ip_addr") == 0) { if (hostapd_parse_ip_addr(pos, &bss->own_ip_addr)) { diff --git a/hostapd/defconfig b/hostapd/defconfig -index 64f03bd84..45dee2135 100644 +index a9eab4d9c..7da1da555 100644 --- a/hostapd/defconfig +++ b/hostapd/defconfig @@ -44,6 +44,9 @@ CONFIG_LIBNL32=y @@ -103,7 +73,7 @@ index 64f03bd84..45dee2135 100644 CONFIG_RSN_PREAUTH=y diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf -index e31885545..fcf568b5e 100644 +index f37d5634b..594eb0d17 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -41,6 +41,7 @@ interface=wlan0 @@ -114,7 +84,7 @@ index e31885545..fcf568b5e 100644 # bit 6 (64) = MLME # # Levels (minimum value for logged events): -@@ -1276,6 +1277,11 @@ eap_server=0 +@@ -1438,6 +1439,11 @@ eap_server=0 # Whether to enable ERP on the EAP server. #eap_server_erp=1 @@ -127,7 +97,7 @@ index e31885545..fcf568b5e 100644 ##### RADIUS client configuration ############################################# # for IEEE 802.1X with external Authentication Server, IEEE 802.11 diff --git a/hostapd/main.c b/hostapd/main.c -index 62ee5642e..609b453cb 100644 +index 0d0e92e9e..8de88e513 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -84,6 +84,9 @@ static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module, @@ -141,10 +111,10 @@ index 62ee5642e..609b453cb 100644 module_str = "MLME"; break; diff --git a/src/ap/Makefile b/src/ap/Makefile -index 54e48a0dd..bd3f33b77 100644 +index a1e9b7c44..27a63dac0 100644 --- a/src/ap/Makefile +++ b/src/ap/Makefile -@@ -18,6 +18,7 @@ CFLAGS += -DCONFIG_IEEE80211R_AP +@@ -8,6 +8,7 @@ CFLAGS += -DCONFIG_IEEE80211R_AP CFLAGS += -DCONFIG_WPS CFLAGS += -DCONFIG_PROXYARP CFLAGS += -DCONFIG_IPV6 @@ -152,7 +122,7 @@ index 54e48a0dd..bd3f33b77 100644 CFLAGS += -DCONFIG_AIRTIME_POLICY LIB_OBJS= \ -@@ -40,6 +41,7 @@ LIB_OBJS= \ +@@ -30,6 +31,7 @@ LIB_OBJS= \ hostapd.o \ hs20.o \ hw_features.o \ @@ -161,22 +131,22 @@ index 54e48a0dd..bd3f33b77 100644 ieee802_11.o \ ieee802_11_ht.o \ diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 37ace8fb9..f7b509325 100644 +index f795ee919..529ad0b12 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -339,6 +339,10 @@ struct hostapd_bss_config { - int erp_send_reauth_start; - char *erp_domain; +@@ -346,6 +346,10 @@ struct hostapd_bss_config { + bool eap_skip_prot_success; + #endif /* CONFIG_TESTING_OPTIONS */ + int ieee802_11f; /* use IEEE 802.11f (IAPP) */ + char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast -+ * frames */ ++ * frames */ + - enum macaddr_acl { - ACCEPT_UNLESS_DENIED = 0, - DENY_UNLESS_ACCEPTED = 1, + enum macaddr_acl macaddr_acl; + struct mac_acl_entry *accept_mac; + int num_accept_mac; diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index 5b23208f6..ebc0488d0 100644 +index 1bd525fe9..a4bf68e6f 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -29,6 +29,7 @@ @@ -187,7 +157,7 @@ index 5b23208f6..ebc0488d0 100644 #include "ieee802_1x.h" #include "ieee802_11_auth.h" #include "vlan_init.h" -@@ -426,6 +427,8 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd) +@@ -455,6 +456,8 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd) hapd->beacon_set_done = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -196,12 +166,12 @@ index 5b23208f6..ebc0488d0 100644 accounting_deinit(hapd); hostapd_deinit_wpa(hapd); vlan_deinit(hapd); -@@ -1380,6 +1383,13 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) +@@ -1417,6 +1420,13 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) return -1; } + if (conf->ieee802_11f && -+ (hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) { ++ (hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) { + wpa_printf(MSG_ERROR, "IEEE 802.11F (IAPP) initialization " + "failed."); + return -1; @@ -210,7 +180,7 @@ index 5b23208f6..ebc0488d0 100644 #ifdef CONFIG_INTERWORKING if (gas_serv_init(hapd)) { wpa_printf(MSG_ERROR, "GAS server initialization failed"); -@@ -3238,6 +3248,10 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, +@@ -3313,6 +3323,10 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, ap_sta_clear_disconnect_timeouts(hapd, sta); sta->post_csa_sa_query = 0; @@ -222,10 +192,10 @@ index 5b23208f6..ebc0488d0 100644 if (sta->p2p_ie == NULL && !sta->no_p2p_set) { sta->no_p2p_set = 1; diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h -index 8412ec226..6f844348f 100644 +index aba04a925..ae4f0b26f 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -189,6 +189,8 @@ struct hostapd_data { +@@ -210,6 +210,8 @@ struct hostapd_data { u64 acct_session_id; struct radius_das_data *radius_das; @@ -236,7 +206,7 @@ index 8412ec226..6f844348f 100644 diff --git a/src/ap/iapp.c b/src/ap/iapp.c new file mode 100644 -index 000000000..2556da30c +index 000000000..8faebfded --- /dev/null +++ b/src/ap/iapp.c @@ -0,0 +1,542 @@ @@ -435,7 +405,7 @@ index 000000000..2556da30c + os_memcpy(add->mac_addr, mac_addr, ETH_ALEN); + + add->seq_num = host_to_be16(seq_num); -+ ++ + os_memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = iapp->multicast.s_addr; @@ -852,10 +822,10 @@ index 421977eed..0fc1c2511 100644 #CONFIG_FILS=y #CONFIG_FILS_SK_PFS=y diff --git a/tests/hwsim/example-hostapd.config b/tests/hwsim/example-hostapd.config -index 972d35c75..8b68b5471 100644 +index 5b7130fdc..451414e01 100644 --- a/tests/hwsim/example-hostapd.config +++ b/tests/hwsim/example-hostapd.config -@@ -105,6 +105,7 @@ CONFIG_SUITEB=y +@@ -108,6 +108,7 @@ CONFIG_SUITEB=y #LIBS_c += -fsanitize=undefined CONFIG_MBO=y diff --git a/recipes-connectivity/hostapd/files/913-iapp-improvements.patch b/recipes-connectivity/hostapd/files/913-iapp-improvements.patch index 06e5de7..8cfa296 100644 --- a/recipes-connectivity/hostapd/files/913-iapp-improvements.patch +++ b/recipes-connectivity/hostapd/files/913-iapp-improvements.patch @@ -8,41 +8,37 @@ Subject: [PATCH] ADD: add wpa_supplicant and hostapd to meta layer 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index ebc0488d0..4cfa7d840 100644 +index 7e261209d..21f29ab5b 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -1384,10 +1384,9 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) - } +@@ -1424,8 +1424,8 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) if (conf->ieee802_11f && -- (hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) { + (hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) { - wpa_printf(MSG_ERROR, "IEEE 802.11F (IAPP) initialization " - "failed."); -- return -1; -+ (hapd->iapp = iapp_init(hapd, hapd->conf->iapp_iface)) == NULL) { -+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, -+ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization failed. Try again later"); ++ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, ++ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization failed. Try again later"); + return -1; } - #ifdef CONFIG_INTERWORKING -@@ -3249,8 +3248,19 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, +@@ -3331,6 +3331,19 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, sta->post_csa_sa_query = 0; /* IEEE 802.11F (IAPP) */ -- if (hapd->conf->ieee802_11f) + if (hapd->conf->ieee802_11f) { -+ if (!hapd->iapp) { -+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, -+ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization try again"); -+ hapd->iapp = iapp_init(hapd, hapd->conf->iapp_iface); -+ } -+ if (hapd->iapp) { -+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, -+ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization add new station"); ++ if (!hapd->iapp) { ++ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, ++ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization try again"); ++ hapd->iapp = iapp_init(hapd, hapd->conf->iapp_iface); ++ } ++ if (hapd->iapp) { ++ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, ++ HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization add new station"); ++ iapp_new_station(hapd->iapp, sta); ++ } ++ } ++ + if (hapd->conf->ieee802_11f) iapp_new_station(hapd->iapp, sta); -+ } -+ } -+ - #ifdef CONFIG_P2P - if (sta->p2p_ie == NULL && !sta->no_p2p_set) { diff --git a/recipes-connectivity/hostapd/files/914-wlan-acs-srd-channels.patch b/recipes-connectivity/hostapd/files/914-wlan-acs-srd-channels.patch index 0ae4808..59189f3 100644 --- a/recipes-connectivity/hostapd/files/914-wlan-acs-srd-channels.patch +++ b/recipes-connectivity/hostapd/files/914-wlan-acs-srd-channels.patch @@ -8,50 +8,36 @@ Date: Tue, 28 Jan 2020 15:14:35 +0100 2 files changed, 3 insertions(+) diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c -index 0defd6c7b..698b7f329 100644 +index a0803bad0..2aeb4d984 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c -@@ -1371,6 +1371,8 @@ static void phy_info_freq(struct hostapd_hw_modes *mode, - chan->flag |= HOSTAPD_CHAN_INDOOR_ONLY; +@@ -1578,6 +1578,9 @@ static void phy_info_freq(struct hostapd_hw_modes *mode, if (tb_freq[NL80211_FREQUENCY_ATTR_GO_CONCURRENT]) chan->flag |= HOSTAPD_CHAN_GO_CONCURRENT; -+ if (tb_freq[NL80211_FREQUENCY_ATTR_SRD_CHANNEL]) -+ chan->flag |= HOSTAPD_CHAN_DISABLED; ++ if (tb_freq[NL80211_FREQUENCY_ATTR_SRD_CHANNEL]) ++ chan->flag |= HOSTAPD_CHAN_DISABLED; ++ if (tb_freq[NL80211_FREQUENCY_ATTR_NO_10MHZ]) chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_10; + if (tb_freq[NL80211_FREQUENCY_ATTR_NO_20MHZ]) +diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h +index 0568a7909..1d5bbab23 100644 --- a/src/drivers/nl80211_copy.h +++ b/src/drivers/nl80211_copy.h -@@ -3682,6 +3682,19 @@ enum nl80211_wmm_rule { - * (see &enum nl80211_wmm_rule) - * @NL80211_FREQUENCY_ATTR_NO_HE: HE operation is not allowed on this channel +@@ -4009,6 +4009,8 @@ enum nl80211_wmm_rule { + * as the primary or any of the secondary channels isn't possible + * @NL80211_FREQUENCY_ATTR_NO_EHT: EHT operation is not allowed on this channel * in current regulatory domain. -+ * @NL80211_FREQUENCY_ATTR_OFFSET: frequency offset in KHz -+ * @NL80211_FREQUENCY_ATTR_1MHZ: 1 MHz operation is allowed -+ * on this channel in current regulatory domain. -+ * @NL80211_FREQUENCY_ATTR_2MHZ: 2 MHz operation is allowed -+ * on this channel in current regulatory domain. -+ * @NL80211_FREQUENCY_ATTR_4MHZ: 4 MHz operation is allowed -+ * on this channel in current regulatory domain. -+ * @NL80211_FREQUENCY_ATTR_8MHZ: 8 MHz operation is allowed -+ * on this channel in current regulatory domain. -+ * @NL80211_FREQUENCY_ATTR_16MHZ: 16 MHz operation is allowed -+ * on this channel in current regulatory domain. + * @NL80211_FREQUENCY_ATTR_SRD_CHANNEL: short range devices mode -+ * on this channel in current regulatory domain. ++ * on this channel in current regulatory domain. * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number * currently defined * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use -@@ -3712,6 +3725,13 @@ enum nl80211_frequency_attr { - NL80211_FREQUENCY_ATTR_NO_10MHZ, - NL80211_FREQUENCY_ATTR_WMM, - NL80211_FREQUENCY_ATTR_NO_HE, -+ NL80211_FREQUENCY_ATTR_OFFSET, -+ NL80211_FREQUENCY_ATTR_1MHZ, -+ NL80211_FREQUENCY_ATTR_2MHZ, -+ NL80211_FREQUENCY_ATTR_4MHZ, -+ NL80211_FREQUENCY_ATTR_8MHZ, -+ NL80211_FREQUENCY_ATTR_16MHZ, +@@ -4047,6 +4049,7 @@ enum nl80211_frequency_attr { + NL80211_FREQUENCY_ATTR_16MHZ, + NL80211_FREQUENCY_ATTR_NO_320MHZ, + NL80211_FREQUENCY_ATTR_NO_EHT, + NL80211_FREQUENCY_ATTR_SRD_CHANNEL, /* keep last */ diff --git a/recipes-connectivity/hostapd/files/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch b/recipes-connectivity/hostapd/files/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch new file mode 100644 index 0000000..3665c6c --- /dev/null +++ b/recipes-connectivity/hostapd/files/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch @@ -0,0 +1,38 @@ +From f0e9f5aab52b3eab85d28338cc996972ced4c39c Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Tue, 17 May 2022 23:07:59 +0200 +Subject: [PATCH] ctrl: make WNM_AP functions dependant on CONFIG_AP + +This fixes linking errors found when compiling wpa_supplicant with +CONFIG_WNM_AP enabled but CONFIG_AP disabled. + +Signed-off-by: David Bauer +--- + wpa_supplicant/ctrl_iface.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c +index ac337e0f5..6e23114e6 100644 +--- a/wpa_supplicant/ctrl_iface.c ++++ b/wpa_supplicant/ctrl_iface.c +@@ -12185,7 +12185,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, + if (wpas_ctrl_iface_coloc_intf_report(wpa_s, buf + 18)) + reply_len = -1; + #endif /* CONFIG_WNM */ +-#ifdef CONFIG_WNM_AP ++#if defined(CONFIG_AP) && defined(CONFIG_WNM_AP) + } else if (os_strncmp(buf, "DISASSOC_IMMINENT ", 18) == 0) { + if (ap_ctrl_iface_disassoc_imminent(wpa_s, buf + 18)) + reply_len = -1; +@@ -12195,7 +12195,7 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, + } else if (os_strncmp(buf, "BSS_TM_REQ ", 11) == 0) { + if (ap_ctrl_iface_bss_tm_req(wpa_s, buf + 11)) + reply_len = -1; +-#endif /* CONFIG_WNM_AP */ ++#endif /* CONFIG_AP && CONFIG_WNM_AP */ + } else if (os_strcmp(buf, "FLUSH") == 0) { + wpa_supplicant_ctrl_iface_flush(wpa_s); + } else if (os_strncmp(buf, "RADIO_WORK ", 11) == 0) { +-- +2.35.1 + diff --git a/recipes-connectivity/hostapd/files/991-fix-compile.patch b/recipes-connectivity/hostapd/files/991-fix-compile.patch new file mode 100644 index 0000000..d08efa0 --- /dev/null +++ b/recipes-connectivity/hostapd/files/991-fix-compile.patch @@ -0,0 +1,19 @@ +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -8104,6 +8104,7 @@ int wpas_network_disabled(struct wpa_sup + !ssid->mem_only_psk) + return 1; + ++#ifdef CONFIG_IEEE8021X_EAPOL + #ifdef CRYPTO_RSA_OAEP_SHA256 + if (ssid->eap.imsi_privacy_cert) { + struct crypto_rsa_key *key; +@@ -8121,7 +8122,7 @@ int wpas_network_disabled(struct wpa_sup + } + } + #endif /* CRYPTO_RSA_OAEP_SHA256 */ +- ++#endif /* CONFIG_IEEE8021X_EAPOL */ + return 0; + } + diff --git a/recipes-connectivity/hostapd/files/992-openssl-include-rsa.patch b/recipes-connectivity/hostapd/files/992-openssl-include-rsa.patch new file mode 100644 index 0000000..581ae9f --- /dev/null +++ b/recipes-connectivity/hostapd/files/992-openssl-include-rsa.patch @@ -0,0 +1,32 @@ +From f374d52079111a4340acb6df835f45ac6b5f3f60 Mon Sep 17 00:00:00 2001 +From: Andre Heider +Date: Wed, 22 Jun 2022 14:13:55 +0200 +Subject: OpenSSL: Include rsa.h for all OpenSSL versions + +This fixes the build with OpenSSL 1.1.1: +../src/crypto/crypto_openssl.c: In function 'crypto_rsa_oaep_sha256_decrypt': +../src/crypto/crypto_openssl.c:4404:49: error: 'RSA_PKCS1_OAEP_PADDING' undeclared (first use in this function) + +Signed-off-by: Andre Heider +--- + src/crypto/crypto_openssl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/crypto/crypto_openssl.c ++++ b/src/crypto/crypto_openssl.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + #include + #ifdef CONFIG_ECC + #include +@@ -25,7 +26,6 @@ + #include + #include + #include +-#include + #include + #include + #else /* OpenSSL version >= 3.0 */ diff --git a/recipes-connectivity/hostapd/files/hostapd-full.config b/recipes-connectivity/hostapd/files/hostapd-full.config index 45345c9..a029562 100644 --- a/recipes-connectivity/hostapd/files/hostapd-full.config +++ b/recipes-connectivity/hostapd/files/hostapd-full.config @@ -186,7 +186,7 @@ CONFIG_IEEE80211AC=y #CONFIG_DEBUG_FILE=y # Send debug messages to syslog instead of stdout -# CONFIG_DEBUG_SYSLOG=y +CONFIG_DEBUG_SYSLOG=y # Add support for sending all debug messages (regardless of debug verbosity) # to the Linux kernel tracing facility. This helps debug the entire stack by diff --git a/recipes-connectivity/hostapd/files/src/ap/ubus.c b/recipes-connectivity/hostapd/files/src/ap/ubus.c index d03b848..622eab8 100644 --- a/recipes-connectivity/hostapd/files/src/ap/ubus.c +++ b/recipes-connectivity/hostapd/files/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" @@ -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 +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 }, + { "he", WLAN_STA_HE }, { "wps", WLAN_STA_WPS }, { "mfp", WLAN_STA_MFP }, }; @@ -314,10 +318,24 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_u8(&b, sta_flags[i].name, !!(sta->flags & sta_flags[i].flag)); +#ifdef CONFIG_MBO + blobmsg_add_u8(&b, "mbo", !!(sta->cell_capa)); +#endif + r = blobmsg_open_array(&b, "rrm"); for (i = 0; i < ARRAY_SIZE(sta->rrm_enabled_capa); i++) blobmsg_add_u32(&b, "", sta->rrm_enabled_capa[i]); blobmsg_close_array(&b, r); + + r = blobmsg_open_array(&b, "extended_capabilities"); + /* Check if client advertises extended capabilities */ + if (sta->ext_capability && sta->ext_capability[0] > 0) { + for (i = 0; i < sta->ext_capability[0]; i++) { + blobmsg_add_u32(&b, "", sta->ext_capability[1 + i]); + } + } + blobmsg_close_array(&b, r); + blobmsg_add_u32(&b, "aid", sta->aid); #ifdef CONFIG_TAXONOMY r = blobmsg_alloc_string_buffer(&b, "signature", 1024); @@ -372,24 +390,87 @@ hostapd_bss_get_features(struct ubus_context *ctx, struct ubus_object *obj, return 0; } +/* Imported from iw/util.c + * https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/tree/util.c?id=4b25ae3537af48dbf9d0abf94132e5ba01b32c18#n200 + */ +int ieee80211_frequency_to_channel(int freq) +{ + /* see 802.11-2007 17.3.8.3.2 and Annex J */ + if (freq == 2484) + return 14; + /* see 802.11ax D6.1 27.3.23.2 and Annex E */ + else if (freq == 5935) + return 2; + else if (freq < 2484) + return (freq - 2407) / 5; + else if (freq >= 4910 && freq <= 4980) + return (freq - 4000) / 5; + else if (freq < 5950) + return (freq - 5000) / 5; + else if (freq <= 45000) /* DMG band lower limit */ + /* see 802.11ax D6.1 27.3.23.2 */ + return (freq - 5950) / 5; + else if (freq >= 58320 && freq <= 70200) + return (freq - 56160) / 2160; + else + return 0; +} + static int hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); - void *airtime_table, *dfs_table; + void *airtime_table, *dfs_table, *rrm_table, *wnm_table; struct os_reltime now; + char ssid[SSID_MAX_LEN + 1]; 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)); + blobmsg_printf(&b, "bssid", MACSTR, MAC2STR(hapd->conf->bssid)); + + memset(ssid, 0, SSID_MAX_LEN + 1); + memcpy(ssid, hapd->conf->ssid.ssid, ssid_len); + blobmsg_add_string(&b, "ssid", ssid); + blobmsg_add_u32(&b, "freq", 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); +#ifdef CONFIG_IEEE80211AX + blobmsg_add_u32(&b, "bss_color", hapd->iface->conf->he_op.he_bss_color_disabled ? -1 : + hapd->iface->conf->he_op.he_bss_color); +#else + blobmsg_add_u32(&b, "bss_color", -1); +#endif snprintf(phy_name, 17, "%s", hapd->iface->phy); blobmsg_add_string(&b, "phy", phy_name); + /* RRM */ + rrm_table = blobmsg_open_table(&b, "rrm"); + blobmsg_add_u64(&b, "neighbor_report_tx", hapd->openwrt_stats.rrm.neighbor_report_tx); + blobmsg_close_table(&b, rrm_table); + + /* WNM */ + wnm_table = blobmsg_open_table(&b, "wnm"); + blobmsg_add_u64(&b, "bss_transition_query_rx", hapd->openwrt_stats.wnm.bss_transition_query_rx); + blobmsg_add_u64(&b, "bss_transition_request_tx", hapd->openwrt_stats.wnm.bss_transition_request_tx); + blobmsg_add_u64(&b, "bss_transition_response_rx", hapd->openwrt_stats.wnm.bss_transition_response_rx); + blobmsg_close_table(&b, wnm_table); + /* Airtime */ airtime_table = blobmsg_open_table(&b, "airtime"); blobmsg_add_u64(&b, "time", hapd->iface->last_channel_time); @@ -703,7 +784,9 @@ enum { CSA_SEC_CHANNEL_OFFSET, CSA_HT, CSA_VHT, + CSA_HE, CSA_BLOCK_TX, + CSA_FORCE, __CSA_MAX }; @@ -716,9 +799,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 }, + [CSA_HE] = { "he", BLOBMSG_TYPE_BOOL }, [CSA_BLOCK_TX] = { "block_tx", BLOBMSG_TYPE_BOOL }, + [CSA_FORCE] = { "force", BLOBMSG_TYPE_BOOL }, }; + +static void switch_chan_fallback_cb(void *eloop_data, void *user_ctx) +{ + struct hostapd_iface *iface = eloop_data; + struct hostapd_freq_params *freq_params = user_ctx; + + hostapd_switch_channel_fallback(iface, freq_params); +} + #ifdef NEED_AP_MLME static int hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, @@ -727,14 +821,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, + .vht_enabled = iconf->ieee80211ac, + .he_enabled = iconf->ieee80211ax, + .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; blobmsg_parse(csa_policy, __CSA_MAX, tb, blob_data(msg), blob_len(msg)); if (!tb[CSA_FREQ]) return UBUS_STATUS_INVALID_ARGUMENT; - memset(&css, 0, sizeof(css)); + switch (iconf->vht_oper_chwidth) { + case CHANWIDTH_USE_HT: + if (iconf->secondary_channel) + css.freq_params.bandwidth = 40; + else + css.freq_params.bandwidth = 20; + break; + case CHANWIDTH_160MHZ: + css.freq_params.bandwidth = 160; + break; + default: + css.freq_params.bandwidth = 80; + break; + } + css.freq_params.freq = blobmsg_get_u32(tb[CSA_FREQ]); #define SET_CSA_SETTING(name, field, type) \ @@ -750,12 +872,57 @@ 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.eht_enabled, + css.freq_params.sec_channel_offset, + chwidth, seg0, seg1, + iconf->vht_capab, + mode ? &mode->he_capab[IEEE80211_MODE_AP] : + NULL, + mode ? &mode->eht_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(bss, &css) != 0) + ret = UBUS_STATUS_NOT_SUPPORTED; + } + + if (!ret || !tb[CSA_FORCE] || !blobmsg_get_bool(tb[CSA_FORCE])) + return ret; + + freq_params = malloc(sizeof(*freq_params)); + memcpy(freq_params, &css.freq_params, sizeof(*freq_params)); + eloop_register_timeout(0, 1, switch_chan_fallback_cb, + hapd->iface, freq_params); + + return 0; #undef SET_CSA_SETTING } #endif @@ -841,6 +1008,7 @@ hostapd_rrm_print_nr(struct hostapd_neighbor_entry *nr) enum { BSS_MGMT_EN_NEIGHBOR, BSS_MGMT_EN_BEACON, + BSS_MGMT_EN_LINK_MEASUREMENT, #ifdef CONFIG_WNM_AP BSS_MGMT_EN_BSS_TRANSITION, #endif @@ -868,6 +1036,14 @@ __hostapd_bss_mgmt_enable_f(struct hostapd_data *hapd, int flag) WLAN_RRM_CAPS_BEACON_REPORT_ACTIVE | WLAN_RRM_CAPS_BEACON_REPORT_TABLE; + if (bss->radio_measurements[0] & flags == flags) + return false; + + bss->radio_measurements[0] |= (u8) flags; + return true; + case BSS_MGMT_EN_LINK_MEASUREMENT: + flags = WLAN_RRM_CAPS_LINK_MEASUREMENT; + if (bss->radio_measurements[0] & flags == flags) return false; @@ -905,6 +1081,7 @@ __hostapd_bss_mgmt_enable(struct hostapd_data *hapd, uint32_t flags) static const struct blobmsg_policy bss_mgmt_enable_policy[__BSS_MGMT_EN_MAX] = { [BSS_MGMT_EN_NEIGHBOR] = { "neighbor_report", BLOBMSG_TYPE_BOOL }, [BSS_MGMT_EN_BEACON] = { "beacon_report", BLOBMSG_TYPE_BOOL }, + [BSS_MGMT_EN_LINK_MEASUREMENT] = { "link_measurement", BLOBMSG_TYPE_BOOL }, #ifdef CONFIG_WNM_AP [BSS_MGMT_EN_BSS_TRANSITION] = { "bss_transition", BLOBMSG_TYPE_BOOL }, #endif @@ -1085,7 +1262,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; @@ -1183,62 +1360,127 @@ hostapd_rrm_beacon_req(struct ubus_context *ctx, struct ubus_object *obj, return 0; } - -#ifdef CONFIG_WNM_AP enum { - WNM_DISASSOC_ADDR, - WNM_DISASSOC_DURATION, - WNM_DISASSOC_NEIGHBORS, - WNM_DISASSOC_ABRIDGED, - __WNM_DISASSOC_MAX, + LM_REQ_ADDR, + LM_REQ_TX_POWER_USED, + LM_REQ_TX_POWER_MAX, + __LM_REQ_MAX, }; -static const struct blobmsg_policy wnm_disassoc_policy[__WNM_DISASSOC_MAX] = { - [WNM_DISASSOC_ADDR] = { "addr", BLOBMSG_TYPE_STRING }, - [WNM_DISASSOC_DURATION] { "duration", BLOBMSG_TYPE_INT32 }, - [WNM_DISASSOC_NEIGHBORS] { "neighbors", BLOBMSG_TYPE_ARRAY }, - [WNM_DISASSOC_ABRIDGED] { "abridged", BLOBMSG_TYPE_BOOL }, +static const struct blobmsg_policy lm_req_policy[__LM_REQ_MAX] = { + [LM_REQ_ADDR] = { "addr", BLOBMSG_TYPE_STRING }, + [LM_REQ_TX_POWER_USED] = { "tx-power-used", BLOBMSG_TYPE_INT32 }, + [LM_REQ_TX_POWER_MAX] = { "tx-power-max", BLOBMSG_TYPE_INT32 }, }; static int -hostapd_wnm_disassoc_imminent(struct ubus_context *ctx, struct ubus_object *obj, - struct ubus_request_data *ureq, const char *method, - struct blob_attr *msg) +hostapd_rrm_lm_req(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *ureq, const char *method, + struct blob_attr *msg) { struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); - struct blob_attr *tb[__WNM_DISASSOC_MAX]; + struct blob_attr *tb[__LM_REQ_MAX]; + struct wpabuf *buf; + u8 addr[ETH_ALEN]; + int ret; + int8_t txp_used, txp_max; + + txp_used = 0; + txp_max = 0; + + blobmsg_parse(lm_req_policy, __LM_REQ_MAX, tb, blob_data(msg), blob_len(msg)); + + if (!tb[LM_REQ_ADDR]) + return UBUS_STATUS_INVALID_ARGUMENT; + + if (tb[LM_REQ_TX_POWER_USED]) + txp_used = (int8_t) blobmsg_get_u32(tb[LM_REQ_TX_POWER_USED]); + + if (tb[LM_REQ_TX_POWER_MAX]) + txp_max = (int8_t) blobmsg_get_u32(tb[LM_REQ_TX_POWER_MAX]); + + if (hwaddr_aton(blobmsg_data(tb[LM_REQ_ADDR]), addr)) + return UBUS_STATUS_INVALID_ARGUMENT; + + buf = wpabuf_alloc(5); + if (!buf) + return UBUS_STATUS_UNKNOWN_ERROR; + + wpabuf_put_u8(buf, WLAN_ACTION_RADIO_MEASUREMENT); + wpabuf_put_u8(buf, WLAN_RRM_LINK_MEASUREMENT_REQUEST); + wpabuf_put_u8(buf, 1); + /* TX-Power used */ + wpabuf_put_u8(buf, txp_used); + /* Max TX Power */ + wpabuf_put_u8(buf, txp_max); + + ret = hostapd_drv_send_action(hapd, hapd->iface->freq, 0, addr, + wpabuf_head(buf), wpabuf_len(buf)); + + wpabuf_free(buf); + if (ret < 0) + return -ret; + + return 0; +} + + +void hostapd_ubus_handle_link_measurement(struct hostapd_data *hapd, const u8 *data, size_t len) +{ + const struct ieee80211_mgmt *mgmt = (const struct ieee80211_mgmt *) data; + const u8 *pos, *end; + u8 token; + + end = data + len; + token = mgmt->u.action.u.rrm.dialog_token; + pos = mgmt->u.action.u.rrm.variable; + + if (end - pos < 8) + return; + + if (!hapd->ubus.obj.has_subscribers) + return; + + blob_buf_init(&b, 0); + blobmsg_add_macaddr(&b, "address", mgmt->sa); + blobmsg_add_u16(&b, "dialog-token", token); + blobmsg_add_u16(&b, "rx-antenna-id", pos[4]); + blobmsg_add_u16(&b, "tx-antenna-id", pos[5]); + blobmsg_add_u16(&b, "rcpi", pos[6]); + blobmsg_add_u16(&b, "rsni", pos[7]); + + ubus_notify(ctx, &hapd->ubus.obj, "link-measurement-report", b.head, -1); +} + + +#ifdef CONFIG_WNM_AP + +static int +hostapd_bss_tr_send(struct hostapd_data *hapd, u8 *addr, bool disassoc_imminent, bool abridged, + u16 disassoc_timer, u8 validity_period, u8 dialog_token, + struct blob_attr *neighbors, u8 mbo_reason, u8 cell_pref, u8 reassoc_delay) +{ struct blob_attr *cur; struct sta_info *sta; - int duration = 10; - int rem; int nr_len = 0; + int rem; u8 *nr = NULL; - u8 req_mode = WNM_BSS_TM_REQ_DISASSOC_IMMINENT; - u8 addr[ETH_ALEN]; - - blobmsg_parse(wnm_disassoc_policy, __WNM_DISASSOC_MAX, tb, blob_data(msg), blob_len(msg)); - - if (!tb[WNM_DISASSOC_ADDR]) - return UBUS_STATUS_INVALID_ARGUMENT; - - if (hwaddr_aton(blobmsg_data(tb[WNM_DISASSOC_ADDR]), addr)) - return UBUS_STATUS_INVALID_ARGUMENT; - - if ((cur = tb[WNM_DISASSOC_DURATION]) != NULL) - duration = blobmsg_get_u32(cur); + u8 req_mode = 0; + u8 mbo[10]; + size_t mbo_len = 0; sta = ap_get_sta(hapd, addr); if (!sta) return UBUS_STATUS_NOT_FOUND; - if (tb[WNM_DISASSOC_NEIGHBORS]) { + if (neighbors) { u8 *nr_cur; - if (blobmsg_check_array(tb[WNM_DISASSOC_NEIGHBORS], + if (blobmsg_check_array(neighbors, BLOBMSG_TYPE_STRING) < 0) return UBUS_STATUS_INVALID_ARGUMENT; - blobmsg_for_each_attr(cur, tb[WNM_DISASSOC_NEIGHBORS], rem) { + blobmsg_for_each_attr(cur, neighbors, rem) { int len = strlen(blobmsg_get_string(cur)); if (len % 2) @@ -1254,7 +1496,7 @@ hostapd_wnm_disassoc_imminent(struct ubus_context *ctx, struct ubus_object *obj, } nr_cur = nr; - blobmsg_for_each_attr(cur, tb[WNM_DISASSOC_NEIGHBORS], rem) { + blobmsg_for_each_attr(cur, neighbors, rem) { int len = strlen(blobmsg_get_string(cur)) / 2; *nr_cur++ = WLAN_EID_NEIGHBOR_REPORT; @@ -1271,22 +1513,195 @@ hostapd_wnm_disassoc_imminent(struct ubus_context *ctx, struct ubus_object *obj, if (nr) req_mode |= WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED; - if (tb[WNM_DISASSOC_ABRIDGED] && blobmsg_get_bool(tb[WNM_DISASSOC_ABRIDGED])) + if (abridged) req_mode |= WNM_BSS_TM_REQ_ABRIDGED; - if (wnm_send_bss_tm_req(hapd, sta, req_mode, duration, duration, NULL, - NULL, nr, nr_len, NULL, 0)) + if (disassoc_imminent) + req_mode |= WNM_BSS_TM_REQ_DISASSOC_IMMINENT; + +#ifdef CONFIG_MBO + u8 *mbo_pos = mbo; + + if (mbo_reason > MBO_TRANSITION_REASON_PREMIUM_AP) + return UBUS_STATUS_INVALID_ARGUMENT; + + if (cell_pref != 0 && cell_pref != 1 && cell_pref != 255) + return UBUS_STATUS_INVALID_ARGUMENT; + + if (reassoc_delay > 65535 || (reassoc_delay && !disassoc_imminent)) + return UBUS_STATUS_INVALID_ARGUMENT; + + *mbo_pos++ = MBO_ATTR_ID_TRANSITION_REASON; + *mbo_pos++ = 1; + *mbo_pos++ = mbo_reason; + *mbo_pos++ = MBO_ATTR_ID_CELL_DATA_PREF; + *mbo_pos++ = 1; + *mbo_pos++ = cell_pref; + + if (reassoc_delay) { + *mbo_pos++ = MBO_ATTR_ID_ASSOC_RETRY_DELAY; + *mbo_pos++ = 2; + WPA_PUT_LE16(mbo_pos, reassoc_delay); + mbo_pos += 2; + } + + mbo_len = mbo_pos - mbo; +#endif + + if (wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer, validity_period, NULL, + dialog_token, NULL, nr, nr_len, mbo_len ? mbo : NULL, mbo_len)) return UBUS_STATUS_UNKNOWN_ERROR; return 0; } + +enum { + BSS_TR_ADDR, + BSS_TR_DA_IMMINENT, + BSS_TR_DA_TIMER, + BSS_TR_VALID_PERIOD, + BSS_TR_NEIGHBORS, + BSS_TR_ABRIDGED, + BSS_TR_DIALOG_TOKEN, +#ifdef CONFIG_MBO + BSS_TR_MBO_REASON, + BSS_TR_CELL_PREF, + BSS_TR_REASSOC_DELAY, #endif + __BSS_TR_DISASSOC_MAX +}; + +static const struct blobmsg_policy bss_tr_policy[__BSS_TR_DISASSOC_MAX] = { + [BSS_TR_ADDR] = { "addr", BLOBMSG_TYPE_STRING }, + [BSS_TR_DA_IMMINENT] = { "disassociation_imminent", BLOBMSG_TYPE_BOOL }, + [BSS_TR_DA_TIMER] = { "disassociation_timer", BLOBMSG_TYPE_INT32 }, + [BSS_TR_VALID_PERIOD] = { "validity_period", BLOBMSG_TYPE_INT32 }, + [BSS_TR_NEIGHBORS] = { "neighbors", BLOBMSG_TYPE_ARRAY }, + [BSS_TR_ABRIDGED] = { "abridged", BLOBMSG_TYPE_BOOL }, + [BSS_TR_DIALOG_TOKEN] = { "dialog_token", BLOBMSG_TYPE_INT32 }, +#ifdef CONFIG_MBO + [BSS_TR_MBO_REASON] = { "mbo_reason", BLOBMSG_TYPE_INT32 }, + [BSS_TR_CELL_PREF] = { "cell_pref", BLOBMSG_TYPE_INT32 }, + [BSS_TR_REASSOC_DELAY] = { "reassoc_delay", BLOBMSG_TYPE_INT32 }, +#endif +}; + +static int +hostapd_bss_transition_request(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *ureq, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); + struct blob_attr *tb[__BSS_TR_DISASSOC_MAX]; + struct sta_info *sta; + u32 da_timer = 0; + u32 valid_period = 0; + u8 addr[ETH_ALEN]; + u32 dialog_token = 1; + bool abridged; + bool da_imminent; + u8 mbo_reason; + u8 cell_pref; + u8 reassoc_delay; + + blobmsg_parse(bss_tr_policy, __BSS_TR_DISASSOC_MAX, tb, blob_data(msg), blob_len(msg)); + + if (!tb[BSS_TR_ADDR]) + return UBUS_STATUS_INVALID_ARGUMENT; + + if (hwaddr_aton(blobmsg_data(tb[BSS_TR_ADDR]), addr)) + return UBUS_STATUS_INVALID_ARGUMENT; + + if (tb[BSS_TR_DA_TIMER]) + da_timer = blobmsg_get_u32(tb[BSS_TR_DA_TIMER]); + + if (tb[BSS_TR_VALID_PERIOD]) + valid_period = blobmsg_get_u32(tb[BSS_TR_VALID_PERIOD]); + + if (tb[BSS_TR_DIALOG_TOKEN]) + dialog_token = blobmsg_get_u32(tb[BSS_TR_DIALOG_TOKEN]); + + da_imminent = !!(tb[BSS_TR_DA_IMMINENT] && blobmsg_get_bool(tb[BSS_TR_DA_IMMINENT])); + abridged = !!(tb[BSS_TR_ABRIDGED] && blobmsg_get_bool(tb[BSS_TR_ABRIDGED])); + +#ifdef CONFIG_MBO + if (tb[BSS_TR_MBO_REASON]) + mbo_reason = blobmsg_get_u32(tb[BSS_TR_MBO_REASON]); + + if (tb[BSS_TR_CELL_PREF]) + cell_pref = blobmsg_get_u32(tb[BSS_TR_CELL_PREF]); + + if (tb[BSS_TR_REASSOC_DELAY]) + reassoc_delay = blobmsg_get_u32(tb[BSS_TR_REASSOC_DELAY]); +#endif + + return hostapd_bss_tr_send(hapd, addr, da_imminent, abridged, da_timer, valid_period, + dialog_token, tb[BSS_TR_NEIGHBORS], mbo_reason, cell_pref, reassoc_delay); +} +#endif + +#ifdef CONFIG_AIRTIME_POLICY +enum { + UPDATE_AIRTIME_STA, + UPDATE_AIRTIME_WEIGHT, + __UPDATE_AIRTIME_MAX, +}; + + +static const struct blobmsg_policy airtime_policy[__UPDATE_AIRTIME_MAX] = { + [UPDATE_AIRTIME_STA] = { "sta", BLOBMSG_TYPE_STRING }, + [UPDATE_AIRTIME_WEIGHT] = { "weight", BLOBMSG_TYPE_INT32 }, +}; + +static int +hostapd_bss_update_airtime(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *ureq, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); + struct blob_attr *tb[__UPDATE_AIRTIME_MAX]; + struct sta_info *sta = NULL; + u8 addr[ETH_ALEN]; + int weight; + + blobmsg_parse(airtime_policy, __UPDATE_AIRTIME_MAX, tb, blob_data(msg), blob_len(msg)); + + if (!tb[UPDATE_AIRTIME_WEIGHT]) + return UBUS_STATUS_INVALID_ARGUMENT; + + weight = blobmsg_get_u32(tb[UPDATE_AIRTIME_WEIGHT]); + + if (!tb[UPDATE_AIRTIME_STA]) { + if (!weight) + return UBUS_STATUS_INVALID_ARGUMENT; + + hapd->conf->airtime_weight = weight; + return 0; + } + + if (hwaddr_aton(blobmsg_data(tb[UPDATE_AIRTIME_STA]), addr)) + return UBUS_STATUS_INVALID_ARGUMENT; + + sta = ap_get_sta(hapd, addr); + if (!sta) + return UBUS_STATUS_NOT_FOUND; + + sta->dyn_airtime_weight = weight; + airtime_policy_new_sta(hapd, sta); + + return 0; +} +#endif + static const struct ubus_method bss_methods[] = { UBUS_METHOD_NOARG("reload", hostapd_bss_reload), UBUS_METHOD_NOARG("get_clients", hostapd_bss_get_clients), UBUS_METHOD_NOARG("get_status", hostapd_bss_get_status), UBUS_METHOD("del_client", hostapd_bss_del_client, del_policy), +#ifdef CONFIG_AIRTIME_POLICY + UBUS_METHOD("update_airtime", hostapd_bss_update_airtime, airtime_policy), +#endif UBUS_METHOD_NOARG("list_bans", hostapd_bss_list_bans), #ifdef CONFIG_WPS UBUS_METHOD_NOARG("wps_start", hostapd_bss_wps_start), @@ -1305,8 +1720,9 @@ static const struct ubus_method bss_methods[] = { UBUS_METHOD_NOARG("rrm_nr_list", hostapd_rrm_nr_list), UBUS_METHOD("rrm_nr_set", hostapd_rrm_nr_set, nr_set_policy), UBUS_METHOD("rrm_beacon_req", hostapd_rrm_beacon_req, beacon_req_policy), + UBUS_METHOD("link_measurement_req", hostapd_rrm_lm_req, lm_req_policy), #ifdef CONFIG_WNM_AP - UBUS_METHOD("wnm_disassoc_imminent", hostapd_wnm_disassoc_imminent, wnm_disassoc_policy), + UBUS_METHOD("bss_transition_request", hostapd_bss_transition_request, bss_tr_policy), #endif }; @@ -1351,6 +1767,11 @@ void hostapd_ubus_free_bss(struct hostapd_data *hapd) struct ubus_object *obj = &hapd->ubus.obj; char *name = (char *) obj->name; +#ifdef CONFIG_MESH + if (hapd->conf->mesh & MESH_ENABLED) + return; +#endif + if (!ctx) return; @@ -1364,6 +1785,43 @@ void hostapd_ubus_free_bss(struct hostapd_data *hapd) free(name); } +static void +hostapd_ubus_vlan_action(struct hostapd_data *hapd, struct hostapd_vlan *vlan, + const char *action) +{ + struct vlan_description *desc = &vlan->vlan_desc; + void *c; + int i; + + if (!hapd->ubus.obj.has_subscribers) + return; + + blob_buf_init(&b, 0); + blobmsg_add_string(&b, "ifname", vlan->ifname); + blobmsg_add_string(&b, "bridge", vlan->bridge); + blobmsg_add_u32(&b, "vlan_id", vlan->vlan_id); + + if (desc->notempty) { + blobmsg_add_u32(&b, "untagged", desc->untagged); + c = blobmsg_open_array(&b, "tagged"); + for (i = 0; i < ARRAY_SIZE(desc->tagged) && desc->tagged[i]; i++) + blobmsg_add_u32(&b, "", desc->tagged[i]); + blobmsg_close_array(&b, c); + } + + ubus_notify(ctx, &hapd->ubus.obj, action, b.head, -1); +} + +void hostapd_ubus_add_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan) +{ + hostapd_ubus_vlan_action(hapd, vlan, "vlan_add"); +} + +void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan) +{ + hostapd_ubus_vlan_action(hapd, vlan, "vlan_remove"); +} + 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), @@ -1550,3 +2008,103 @@ void hostapd_ubus_notify_beacon_report( ubus_notify(ctx, &hapd->ubus.obj, "beacon-report", b.head, -1); } + +void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency, + int chan_width, int cf1, int cf2) +{ + struct hostapd_data *hapd; + int i; + + blob_buf_init(&b, 0); + blobmsg_add_u16(&b, "frequency", frequency); + blobmsg_add_u16(&b, "width", chan_width); + blobmsg_add_u16(&b, "center1", cf1); + blobmsg_add_u16(&b, "center2", cf2); + + for (i = 0; i < iface->num_bss; i++) { + hapd = iface->bss[i]; + ubus_notify(ctx, &hapd->ubus.obj, "radar-detected", b.head, -1); + } +} + +#ifdef CONFIG_WNM_AP +static void hostapd_ubus_notify_bss_transition_add_candidate_list( + const u8 *candidate_list, u16 candidate_list_len) +{ + char *cl_str; + int i; + + if (candidate_list_len == 0) + return; + + cl_str = blobmsg_alloc_string_buffer(&b, "candidate-list", candidate_list_len * 2 + 1); + for (i = 0; i < candidate_list_len; i++) + snprintf(&cl_str[i*2], 3, "%02X", candidate_list[i]); + blobmsg_add_string_buffer(&b); + +} +#endif + +void hostapd_ubus_notify_bss_transition_response( + struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 status_code, + u8 bss_termination_delay, const u8 *target_bssid, + const u8 *candidate_list, u16 candidate_list_len) +{ +#ifdef CONFIG_WNM_AP + u16 i; + + if (!hapd->ubus.obj.has_subscribers) + return; + + if (!addr) + return; + + blob_buf_init(&b, 0); + blobmsg_add_macaddr(&b, "address", addr); + blobmsg_add_u8(&b, "dialog-token", dialog_token); + blobmsg_add_u8(&b, "status-code", status_code); + blobmsg_add_u8(&b, "bss-termination-delay", bss_termination_delay); + if (target_bssid) + blobmsg_add_macaddr(&b, "target-bssid", target_bssid); + + hostapd_ubus_notify_bss_transition_add_candidate_list(candidate_list, candidate_list_len); + + ubus_notify(ctx, &hapd->ubus.obj, "bss-transition-response", b.head, -1); +#endif +} + +int hostapd_ubus_notify_bss_transition_query( + struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 reason, + const u8 *candidate_list, u16 candidate_list_len) +{ +#ifdef CONFIG_WNM_AP + struct ubus_event_req ureq = {}; + char *cl_str; + u16 i; + + if (!hapd->ubus.obj.has_subscribers) + return 0; + + if (!addr) + return 0; + + blob_buf_init(&b, 0); + blobmsg_add_macaddr(&b, "address", addr); + blobmsg_add_u8(&b, "dialog-token", dialog_token); + blobmsg_add_u8(&b, "reason", reason); + hostapd_ubus_notify_bss_transition_add_candidate_list(candidate_list, candidate_list_len); + + if (!hapd->ubus.notify_response) { + ubus_notify(ctx, &hapd->ubus.obj, "bss-transition-query", b.head, -1); + return 0; + } + + if (ubus_notify_async(ctx, &hapd->ubus.obj, "bss-transition-query", b.head, &ureq.nreq)) + return 0; + + ureq.nreq.status_cb = ubus_event_cb; + ubus_complete_request(ctx, &ureq.nreq.req, 100); + + return ureq.resp; +#endif +} diff --git a/recipes-connectivity/hostapd/files/src/ap/ubus.h b/recipes-connectivity/hostapd/files/src/ap/ubus.h index e160173..5a33b62 100644 --- a/recipes-connectivity/hostapd/files/src/ap/ubus.h +++ b/recipes-connectivity/hostapd/files/src/ap/ubus.h @@ -43,16 +43,28 @@ void hostapd_ubus_add_iface(struct hostapd_iface *iface); void hostapd_ubus_free_iface(struct hostapd_iface *iface); void hostapd_ubus_add_bss(struct hostapd_data *hapd); void hostapd_ubus_free_bss(struct hostapd_data *hapd); +void hostapd_ubus_add_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan); +void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan); int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req); +void hostapd_ubus_handle_link_measurement(struct hostapd_data *hapd, const u8 *data, size_t len); void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac); void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd, const u8 *addr, u8 token, u8 rep_mode, struct rrm_measurement_beacon_report *rep, size_t len); +void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency, + int chan_width, int cf1, int cf2); +void hostapd_ubus_notify_bss_transition_response( + struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 status_code, + u8 bss_termination_delay, const u8 *target_bssid, + const u8 *candidate_list, u16 candidate_list_len); void hostapd_ubus_add(struct hapd_interfaces *interfaces); void hostapd_ubus_free(struct hapd_interfaces *interfaces); +int hostapd_ubus_notify_bss_transition_query( + struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 reason, + const u8 *candidate_list, u16 candidate_list_len); #else @@ -74,11 +86,23 @@ static inline void hostapd_ubus_free_bss(struct hostapd_data *hapd) { } +static inline void hostapd_ubus_add_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan) +{ +} + +static inline void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan) +{ +} + static inline int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req) { return 0; } +static inline void hostapd_ubus_handle_link_measurement(struct hostapd_data *hapd, const u8 *data, size_t len) +{ +} + static inline void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac) { } @@ -90,6 +114,17 @@ static inline void hostapd_ubus_notify_beacon_report(struct hostapd_data *hapd, size_t len) { } +static inline void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequency, + int chan_width, int cf1, int cf2) +{ +} + +static inline void hostapd_ubus_notify_bss_transition_response( + struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 status_code, + u8 bss_termination_delay, const u8 *target_bssid, + const u8 *candidate_list, u16 candidate_list_len) +{ +} static inline void hostapd_ubus_add(struct hapd_interfaces *interfaces) { @@ -98,6 +133,13 @@ static inline void hostapd_ubus_add(struct hapd_interfaces *interfaces) static inline void hostapd_ubus_free(struct hapd_interfaces *interfaces) { } + +static inline int hostapd_ubus_notify_bss_transition_query( + struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 reason, + const u8 *candidate_list, u16 candidate_list_len) +{ + return 0; +} #endif #endif diff --git a/recipes-connectivity/hostapd/files/src/utils/build_features.h b/recipes-connectivity/hostapd/files/src/utils/build_features.h index c7fccad..642a358 100644 --- a/recipes-connectivity/hostapd/files/src/utils/build_features.h +++ b/recipes-connectivity/hostapd/files/src/utils/build_features.h @@ -23,8 +23,6 @@ static inline int has_feature(const char *feat) if (!strcmp(feat, "11r")) return 1; #endif - if (!strcmp(feat, "11w")) - return 1; #ifdef CONFIG_ACS if (!strcmp(feat, "acs")) return 1; @@ -52,6 +50,14 @@ static inline int has_feature(const char *feat) #ifdef CONFIG_WPS if (!strcmp(feat, "wps")) return 1; +#endif +#ifdef CONFIG_FILS + if (!strcmp(feat, "fils")) + return 1; +#endif +#ifdef CONFIG_OCV + if (!strcmp(feat, "ocv")) + return 1; #endif return 0; } diff --git a/recipes-connectivity/hostapd/hostapd.inc b/recipes-connectivity/hostapd/hostapd.inc index 77c8819..aa9460c 100644 --- a/recipes-connectivity/hostapd/hostapd.inc +++ b/recipes-connectivity/hostapd/hostapd.inc @@ -2,9 +2,9 @@ HOMEPAGE = "http://w1.fi/${PN}/" BUGTRACKER = "http://w1.fi/security/" SECTION = "network" LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://COPYING;md5=279b4f5abb9c153c285221855ddb78cc \ - file://README;beginline=1;endline=56;md5=e7d3dbb01f75f0b9799e192731d1e1ff \ - file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=0a8b56d3543498b742b9c0e94cc2d18b" +LIC_FILES_CHKSUM = "file://COPYING;md5=5ebcb90236d1ad640558c3d3cd3035df \ + file://README;beginline=1;endline=56;md5=e3d2f6c2948991e37c1ca4960de84747 \ + file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=76306a95306fee9a976b0ac1be70f705" DEPENDS = "libnl-tiny" PACKAGECONFIG ??= "gnutls" PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt" @@ -20,32 +20,16 @@ SRC_URI = "git://w1.fi/hostap.git;protocol=http;branch=main \ file://src/utils/build_features.h \ file://0001-Add-build-artifact-build_features.h-to-gitignore.patch \ file://0002-Use-environment-variable-EXTRA_CFLAGS.patch \ - file://001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch \ - file://002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch \ - file://003-wpa_supplicant-handle-HT40-and-mode-downgrade-in-AP-.patch \ - file://004-wpa_supplicant-fix-frequency-config-for-non-p2p-vht-.patch \ - file://005-wpa_supplicant-enable-vht-and-he-in-default-config-p.patch \ - file://006-hw_features-better-debug-messages-for-some-error-cas.patch \ - file://007-dfs-use-helper-functions-for-vht-he-parameters.patch \ - file://008-mesh-use-setup-completion-callback-to-complete-mesh-.patch \ - file://009-mesh-update-ssid-frequency-as-pri-sec-channel-switch.patch \ + file://001-wolfssl-init-RNG-with-ECC-key.patch \ file://010-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch \ - file://011-mesh-do-not-set-offchanok-on-DFS-channels-in-non-ETS.patch \ - file://012-mesh-fix-channel-switch-error-during-CAC.patch \ - file://013-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch \ - file://014-mesh-fixes-for-mesh-init-deinit.patch \ - file://015-mesh-fix-DFS-deinit-init.patch \ - file://016-tests-DFS-test-for-wpa_supplicant-mesh.patch \ - file://017-mesh-fix-mesh_oom-test.patch \ - file://018-mesh-move-mesh-freq-setting-to-own-function.patch \ - file://019-mesh-use-deterministic-channel-on-channel-switch.patch \ - file://020-ignore-4addr-mode-enabling-error.patch \ - file://050-mesh-make-forwarding-configurable.patch \ - file://060-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch \ + file://011-mesh-use-deterministic-channel-on-channel-switch.patch \ + file://021-fix-sta-add-after-previous-connection.patch \ + file://022-hostapd-fix-use-of-uninitialized-stack-variables.patch \ + file://023-ndisc_snoop-call-dl_list_del-before-freeing-ipv6-add.patch \ + file://030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch \ + file://040-mesh-allow-processing-authentication-frames-in-block.patch \ + file://050-build_fix.patch \ file://100-daemonize_fix.patch \ - file://110-notify-mgmt-frames.patch \ - file://110-wolfssl-compile-fix.patch \ - file://120-reconfigure-wps-credentials.patch \ file://200-multicall.patch \ file://300-noscan.patch \ file://301-mesh-noscan.patch \ @@ -71,22 +55,33 @@ SRC_URI = "git://w1.fi/hostap.git;protocol=http;branch=main \ file://461-driver_nl80211-use-new-parameters-during-ibss-join.patch \ file://463-add-mcast_rate-to-11s.patch \ file://464-fix-mesh-obss-check.patch \ + file://465-hostapd-config-support-random-BSS-color.patch \ file://470-survey_data_fallback.patch \ file://500-lto-jobserver-support.patch \ + file://590-rrm-wnm-statistics.patch \ file://599-wpa_supplicant-fix-warnings.patch \ + file://610-hostapd_cli_ujail_permission.patch \ file://700-wifi-reload.patch \ - file://800-dfs-enter-DFS-state-if-no-available-channel-is-found.patch \ - file://801-P2P-Fix-copying-of-secondary-device-types-for-P2P-gr.patch \ + file://710-vlan_no_bridge.patch \ + file://711-wds_bridge_force.patch \ + file://720-iface_max_num_sta.patch \ + file://730-ft_iface.patch \ + file://740-snoop_iface.patch \ + file://750-qos_map_set_without_interworking.patch \ + file://751-qos_map_ignore_when_unsupported.patch \ + file://910-wpa_supplicant_remove_acl.patch \ file://912-iapp-integration.patch \ file://913-iapp-improvements.patch \ file://914-wlan-acs-srd-channels.patch \ + file://990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch \ + file://991-fix-compile.patch \ + file://992-openssl-include-rsa.patch \ file://0001-fix-create-a-versioned-shared-library-libwlan_client.patch \ file://0001-use-nas-port-type-ethernet-for-wired-802.1X.patch \ " -SRCREV = "5a8b366233f5585e68a4ffbb604fbb4a848eb325" -SRC_URI[md5sum] = "a68538fb62766f40f890125026c42c10" -SRC_URI[sha256sum] = "9d9f1c60afa5324ee17219bd3ec61c1a6fa4043b4187da9bb44e59025d3ed31d" +SRCREV = "4383528e01955d995d3b3db201e4c0f9840e8236" +SRC_URI[sha256sum] = "a1330574a241200188ff1478df25b58630012d7db91dfe092b8e0a3c50805ef0" CVE_PRODUCT = "${TARGET_NAME}" CONFFILES_${TARGET_NAME} += "${sysconfdir}/${TARGET_NAME}-full.config" @@ -103,6 +98,8 @@ export EXTRA_CFLAGS = " \ " LDFLAGS += " -Wl,--gc-sections" +EXTRA_OEMAKE_append = " WPAPV=${PV}.0" + export BINDIR = "${sbindir}" do_configure () {