From: Felix Fietkau Date: Thu, 4 Apr 2024 11:19:49 +0000 (+0200) Subject: hostapd: slightly clean up patches X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5aab43f93388b1e35d80892e1534584e83802f89;p=openwrt%2Fstaging%2Fstintel.git hostapd: slightly clean up patches - move build/ifdef related changes together to the 200 patch range - reduce adding/removing include statements across patches - move patches away from the 99x patch range to simplify maintenance Signed-off-by: Felix Fietkau --- diff --git a/package/network/services/hostapd/patches/050-Fix-OpenWrt-13156.patch b/package/network/services/hostapd/patches/050-Fix-OpenWrt-13156.patch new file mode 100644 index 0000000000..a044409d2d --- /dev/null +++ b/package/network/services/hostapd/patches/050-Fix-OpenWrt-13156.patch @@ -0,0 +1,63 @@ +From 26cd9bafc1d25e602952ee86cd2a5b8c3a995490 Mon Sep 17 00:00:00 2001 +From: Stijn Tintel +Date: Fri, 28 Jul 2023 16:27:47 +0300 +Subject: [PATCH] Revert "Do prune_association only after the STA is + authorized" + +Commit e978072baaca ("Do prune_association only after the STA is +authorized") causes issues when an STA roams from one interface to +another interface on the same PHY. The mt7915 driver is not able to +handle this properly. While the commits fixes a DoS, there are other +devices and drivers with the same limitation, so revert to the orginal +behavior for now, until we have a better solution in place. + +Ref: https://github.com/openwrt/openwrt/issues/13156 +Signed-off-by: Stijn Tintel +--- + src/ap/hostapd.c | 14 +++++++++++--- + src/ap/sta_info.c | 3 --- + 2 files changed, 11 insertions(+), 6 deletions(-) + +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -3646,6 +3646,8 @@ int hostapd_remove_iface(struct hapd_int + void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, + int reassoc) + { ++ int mld_assoc_link_id = -1; ++ + if (hapd->tkip_countermeasures) { + hostapd_drv_sta_deauth(hapd, sta->addr, + WLAN_REASON_MICHAEL_MIC_FAILURE); +@@ -3653,10 +3655,16 @@ void hostapd_new_assoc_sta(struct hostap + } + + #ifdef CONFIG_IEEE80211BE +- if (ap_sta_is_mld(hapd, sta) && +- sta->mld_assoc_link_id != hapd->mld_link_id) +- return; ++ if (ap_sta_is_mld(hapd, sta)) { ++ if (sta->mld_assoc_link_id == hapd->mld_link_id) { ++ mld_assoc_link_id = sta->mld_assoc_link_id; ++ } else { ++ return; ++ } ++ } + #endif /* CONFIG_IEEE80211BE */ ++ if (mld_assoc_link_id != -2) ++ hostapd_prune_associations(hapd, sta->addr, mld_assoc_link_id); + + ap_sta_clear_disconnect_timeouts(hapd, sta); + sta->post_csa_sa_query = 0; +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c +@@ -1412,9 +1412,6 @@ bool ap_sta_set_authorized_flag(struct h + mld_assoc_link_id = -2; + } + #endif /* CONFIG_IEEE80211BE */ +- if (mld_assoc_link_id != -2) +- hostapd_prune_associations(hapd, sta->addr, +- mld_assoc_link_id); + sta->flags |= WLAN_STA_AUTHORIZED; + } else { + sta->flags &= ~WLAN_STA_AUTHORIZED; diff --git a/package/network/services/hostapd/patches/051-nl80211-add-extra-ies-only-if-allowed-by-driver.patch b/package/network/services/hostapd/patches/051-nl80211-add-extra-ies-only-if-allowed-by-driver.patch new file mode 100644 index 0000000000..de4d4ad3c2 --- /dev/null +++ b/package/network/services/hostapd/patches/051-nl80211-add-extra-ies-only-if-allowed-by-driver.patch @@ -0,0 +1,62 @@ +From: David Bauer +To: hostap@lists.infradead.org +Cc: =?utf-8?q?=C3=89tienne_Morice?= +Subject: [PATCH] nl80211: add extra-ies only if allowed by driver +Date: Sun, 30 Jan 2022 20:22:00 +0100 +Message-Id: <20220130192200.10883-1-mail@david-bauer.net> +List-Id: + +Upgrading wpa_supplicant from 2.9 to 2.10 breaks broadcom-wl +based adapters. The reason for it is hostapd tries to install additional +IEs for scanning while the driver does not support this. + +The kernel indicates the maximum number of bytes for additional scan IEs +using the NL80211_ATTR_MAX_SCAN_IE_LEN attribute. Save this value and +only add additional scan IEs in case the driver can accommodate these +additional IEs. + +Reported-by: Étienne Morice +Tested-by: Étienne Morice +Signed-off-by: David Bauer +--- + src/drivers/driver.h | 3 +++ + src/drivers/driver_nl80211_capa.c | 4 ++++ + src/drivers/driver_nl80211_scan.c | 2 +- + 3 files changed, 8 insertions(+), 1 deletion(-) + +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -2340,6 +2340,9 @@ struct wpa_driver_capa { + /** Maximum number of iterations in a single scan plan */ + u32 max_sched_scan_plan_iterations; + ++ /** Maximum number of extra IE bytes for scans */ ++ u16 max_scan_ie_len; ++ + /** Whether sched_scan (offloaded scanning) is supported */ + int sched_scan_supported; + +--- a/src/drivers/driver_nl80211_capa.c ++++ b/src/drivers/driver_nl80211_capa.c +@@ -972,6 +972,10 @@ static int wiphy_info_handler(struct nl_ + nla_get_u32(tb[NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS]); + } + ++ if (tb[NL80211_ATTR_MAX_SCAN_IE_LEN]) ++ capa->max_scan_ie_len = ++ nla_get_u16(tb[NL80211_ATTR_MAX_SCAN_IE_LEN]); ++ + if (tb[NL80211_ATTR_MAX_MATCH_SETS]) + capa->max_match_sets = + nla_get_u8(tb[NL80211_ATTR_MAX_MATCH_SETS]); +--- a/src/drivers/driver_nl80211_scan.c ++++ b/src/drivers/driver_nl80211_scan.c +@@ -221,7 +221,7 @@ nl80211_scan_common(struct i802_bss *bss + wpa_printf(MSG_DEBUG, "nl80211: Passive scan requested"); + } + +- if (params->extra_ies) { ++ if (params->extra_ies && drv->capa.max_scan_ie_len >= params->extra_ies_len) { + wpa_hexdump(MSG_MSGDUMP, "nl80211: Scan extra IEs", + params->extra_ies, params->extra_ies_len); + if (nla_put(msg, NL80211_ATTR_IE, params->extra_ies_len, diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 65c1e5d838..1a193b51bb 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -116,7 +116,7 @@ This allows building both hostapd and wpa_supplicant as a single binary struct hapd_interfaces *interfaces = ctx; --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -6760,8 +6760,8 @@ union wpa_event_data { +@@ -6763,8 +6763,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -127,7 +127,7 @@ This allows building both hostapd and wpa_supplicant as a single binary /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -6773,7 +6773,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -6776,7 +6776,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ diff --git a/package/network/services/hostapd/patches/201-lto-jobserver-support.patch b/package/network/services/hostapd/patches/201-lto-jobserver-support.patch new file mode 100644 index 0000000000..ea0dc29081 --- /dev/null +++ b/package/network/services/hostapd/patches/201-lto-jobserver-support.patch @@ -0,0 +1,64 @@ +From: Felix Fietkau +Date: Tue, 10 Jul 2018 13:48:17 +0200 +Subject: [PATCH] hostapd: build with LTO enabled (using jobserver for parallel + build) + +--- a/hostapd/Makefile ++++ b/hostapd/Makefile +@@ -1405,7 +1405,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) + @$(AR) cr $@ hostapd_multi.o $(OBJS) + + hostapd: $(OBJS) +- $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) ++ +$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) + @$(E) " LD " $@ + + ifdef CONFIG_WPA_TRACE +@@ -1416,7 +1416,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) + @$(E) " LD " $@ + + NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) +--- a/wpa_supplicant/Makefile ++++ b/wpa_supplicant/Makefile +@@ -2103,31 +2103,31 @@ wpa_supplicant_multi.a: .config $(BCHECK + @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) + + wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) +- $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) ++ +$(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) + @$(E) " LD " $@ + + LIBCTRL += ../src/common/wpa_ctrl.o diff --git a/package/network/services/hostapd/patches/211-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch b/package/network/services/hostapd/patches/211-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch new file mode 100644 index 0000000000..84fdea8c78 --- /dev/null +++ b/package/network/services/hostapd/patches/211-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch @@ -0,0 +1,33 @@ +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(-) + +--- a/wpa_supplicant/ctrl_iface.c ++++ b/wpa_supplicant/ctrl_iface.c +@@ -13214,7 +13214,7 @@ char * wpa_supplicant_ctrl_iface_process + 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; +@@ -13224,7 +13224,7 @@ char * wpa_supplicant_ctrl_iface_process + } 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) { diff --git a/package/network/services/hostapd/patches/212-Move-definition-of-WLAN_SUPP_RATES_MAX-to-defs.h.patch b/package/network/services/hostapd/patches/212-Move-definition-of-WLAN_SUPP_RATES_MAX-to-defs.h.patch new file mode 100644 index 0000000000..4c568c924c --- /dev/null +++ b/package/network/services/hostapd/patches/212-Move-definition-of-WLAN_SUPP_RATES_MAX-to-defs.h.patch @@ -0,0 +1,56 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Eneas U de Queiroz +Date: Mon, 12 Feb 2024 14:18:24 -0300 +Subject: [PATCH] Move definition of WLAN_SUPP_RATES_MAX to defs.h + +Patch 460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +("wpa_supplicant: add new config params to be used with the ibss join +command") adds the definition of unsigned char +rates[WLAN_SUPP_RATES_MAX] to driver.h, which needs to have +WLAN_SUPP_RATES_MAX defined. So it includes sta_info.h to get the +definition. + +Commit c74739250a ("AP MLD: Use a helper function to check if a STA is a +non-AP MLD") makes sta_info.h include driver.h before +it defines WLAN_SUPP_RATES_MAX, causing an error: + +src/drivers/driver.h:969:29: error: 'WLAN_SUPP_RATES_MAX' undeclared here (not in a function) + +Move the definition of WLAN_SUPP_RATES_MAX to defs.h to ensure it gets +defined before other headers are included. The inclusion of sta_info.h +in driver.h can be reverted as well. + +Signed-off-by: Eneas U de Queiroz +--- + src/ap/sta_info.h | 4 ---- + src/common/defs.h | 4 ++++ + src/drivers/driver.h | 1 - + wpa_supplicant/config_ssid.h | 1 - + 4 files changed, 4 insertions(+), 6 deletions(-) + +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h +@@ -49,10 +49,6 @@ + #define WLAN_STA_PENDING_DEAUTH_CB BIT(30) + #define WLAN_STA_NONERP BIT(31) + +-/* Maximum number of supported rates (from both Supported Rates and Extended +- * Supported Rates IEs). */ +-#define WLAN_SUPP_RATES_MAX 32 +- + struct hostapd_data; + + struct mbo_non_pref_chan_info { +--- a/src/common/defs.h ++++ b/src/common/defs.h +@@ -63,6 +63,10 @@ + WPA_KEY_MGMT_FT_FILS_SHA256 | \ + WPA_KEY_MGMT_FT_FILS_SHA384) + ++/* Maximum number of supported rates (from both Supported Rates and Extended ++ * Supported Rates IEs). */ ++#define WLAN_SUPP_RATES_MAX 32 ++ + static inline int wpa_key_mgmt_wpa_ieee8021x(int akm) + { + return !!(akm & (WPA_KEY_MGMT_IEEE8021X | diff --git a/package/network/services/hostapd/patches/213-wpa_supplicant-fix-warnings.patch b/package/network/services/hostapd/patches/213-wpa_supplicant-fix-warnings.patch new file mode 100644 index 0000000000..4acd7cafe2 --- /dev/null +++ b/package/network/services/hostapd/patches/213-wpa_supplicant-fix-warnings.patch @@ -0,0 +1,32 @@ +From: "Leon M. George" +Date: Wed, 11 Sep 2019 15:22:55 +0200 +Subject: [PATCH] hostapd: declare struct wpa_bss early + +wps_supplicant.h assumes that 'struct wpa_bss' is forward declared if +CONFIG_WPS is not defined. With the later inclusion of +600-ubus_support, the issue manifests in warnings like these: + +wps_supplicant.h:113:15: warning: 'struct wpa_bss' declared inside parameter list will not be visible outside of this definition or declaration + struct wpa_bss *bss) + ^~~~~~~ +This patch forward declares 'struct wpa_bss' regardless. + +--- a/wpa_supplicant/wps_supplicant.h ++++ b/wpa_supplicant/wps_supplicant.h +@@ -9,6 +9,7 @@ + #ifndef WPS_SUPPLICANT_H + #define WPS_SUPPLICANT_H + ++struct wpa_bss; + struct wpa_scan_results; + + #ifdef CONFIG_WPS +@@ -16,8 +17,6 @@ struct wpa_scan_results; + #include "wps/wps.h" + #include "wps/wps_defs.h" + +-struct wpa_bss; +- + struct wps_new_ap_settings { + const char *ssid_hex; + const char *auth; diff --git a/package/network/services/hostapd/patches/220-indicate-features.patch b/package/network/services/hostapd/patches/220-indicate-features.patch new file mode 100644 index 0000000000..006a567c33 --- /dev/null +++ b/package/network/services/hostapd/patches/220-indicate-features.patch @@ -0,0 +1,69 @@ +From: Jo-Philipp Wich +Date: Mon, 12 Dec 2011 17:26:13 +0000 +Subject: [PATCH] hostapd: support optional argument for the -v switch of + hostapd and wpa_supplicant to query build features, e.g. hostapd -veap to + test whether 802.11i support is compiled in + +--- a/hostapd/main.c ++++ b/hostapd/main.c +@@ -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; +@@ -806,7 +806,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:q"); ++ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::"); + if (c < 0) + break; + switch (c) { +@@ -843,6 +843,8 @@ int main(int argc, char *argv[]) + break; + #endif /* CONFIG_DEBUG_LINUX_TRACING */ + case 'v': ++ if (optarg) ++ exit(!has_feature(optarg)); + show_version(); + exit(1); + case 'g': +--- a/wpa_supplicant/main.c ++++ b/wpa_supplicant/main.c +@@ -12,6 +12,7 @@ + #endif /* __linux__ */ + + #include "common.h" ++#include "build_features.h" + #include "crypto/crypto.h" + #include "fst/fst.h" + #include "wpa_supplicant_i.h" +@@ -202,7 +203,7 @@ int main(int argc, char *argv[]) + + for (;;) { + c = getopt(argc, argv, +- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW"); ++ "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuv::W"); + if (c < 0) + break; + switch (c) { +@@ -302,8 +303,12 @@ int main(int argc, char *argv[]) + break; + #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ + case 'v': +- printf("%s\n", wpa_supplicant_version); +- exitcode = 0; ++ if (optarg) { ++ exitcode = !has_feature(optarg); ++ } else { ++ printf("%s\n", wpa_supplicant_version); ++ exitcode = 0; ++ } + goto out; + case 'W': + params.wait_for_monitor++; diff --git a/package/network/services/hostapd/patches/250-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/250-hostapd_cli_ifdef.patch new file mode 100644 index 0000000000..b6421e9d75 --- /dev/null +++ b/package/network/services/hostapd/patches/250-hostapd_cli_ifdef.patch @@ -0,0 +1,61 @@ +From: Felix Fietkau +Date: Thu, 13 Sep 2012 12:39:14 +0000 +Subject: [PATCH] hostapd: support wps in hostapd_cli even when built from the + mini variant + +--- a/hostapd/hostapd_cli.c ++++ b/hostapd/hostapd_cli.c +@@ -401,7 +401,6 @@ static int hostapd_cli_cmd_disassociate( + } + + +-#ifdef CONFIG_TAXONOMY + static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc, + char *argv[]) + { +@@ -414,7 +413,6 @@ static int hostapd_cli_cmd_signature(str + os_snprintf(buf, sizeof(buf), "SIGNATURE %s", argv[0]); + return wpa_ctrl_command(ctrl, buf); + } +-#endif /* CONFIG_TAXONOMY */ + + + static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc, +@@ -431,7 +429,6 @@ static int hostapd_cli_cmd_sa_query(stru + } + + +-#ifdef CONFIG_WPS + static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, + char *argv[]) + { +@@ -657,7 +654,6 @@ static int hostapd_cli_cmd_wps_config(st + ssid_hex, argv[1]); + return wpa_ctrl_command(ctrl, buf); + } +-#endif /* CONFIG_WPS */ + + + static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, +@@ -1670,13 +1666,10 @@ static const struct hostapd_cli_cmd host + { "disassociate", hostapd_cli_cmd_disassociate, + hostapd_complete_stations, + " = disassociate a station" }, +-#ifdef CONFIG_TAXONOMY + { "signature", hostapd_cli_cmd_signature, hostapd_complete_stations, + " = get taxonomy signature for a station" }, +-#endif /* CONFIG_TAXONOMY */ + { "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations, + " = send SA Query to a station" }, +-#ifdef CONFIG_WPS + { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, + " [timeout] [addr] = add WPS Enrollee PIN" }, + { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, +@@ -1701,7 +1694,6 @@ static const struct hostapd_cli_cmd host + " = configure AP" }, + { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, + "= show current WPS status" }, +-#endif /* CONFIG_WPS */ + { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, + "= send Disassociation Imminent notification" }, + { "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, diff --git a/package/network/services/hostapd/patches/251-wpa_cli_ifdef.patch b/package/network/services/hostapd/patches/251-wpa_cli_ifdef.patch new file mode 100644 index 0000000000..d7f967d779 --- /dev/null +++ b/package/network/services/hostapd/patches/251-wpa_cli_ifdef.patch @@ -0,0 +1,22 @@ +From: Felix Fietkau +Date: Mon, 2 Dec 2013 13:07:46 +0000 +Subject: [PATCH] hostapd: always include p2p options in wpa_cli + +--- a/wpa_supplicant/wpa_cli.c ++++ b/wpa_supplicant/wpa_cli.c +@@ -26,6 +26,15 @@ + #include + #endif /* ANDROID */ + ++#ifndef CONFIG_P2P ++#define CONFIG_P2P ++#endif ++#ifndef CONFIG_AP ++#define CONFIG_AP ++#endif ++#ifndef CONFIG_MESH ++#define CONFIG_MESH ++#endif + + static const char *const wpa_cli_version = + "wpa_cli v" VERSION_STR "\n" diff --git a/package/network/services/hostapd/patches/252-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/252-disable_ctrl_iface_mib.patch new file mode 100644 index 0000000000..c65b2b181e --- /dev/null +++ b/package/network/services/hostapd/patches/252-disable_ctrl_iface_mib.patch @@ -0,0 +1,243 @@ +From: Felix Fietkau +Date: Fri, 18 Mar 2011 02:15:52 +0000 +Subject: [PATCH] Remove some unnecessary control interface functionality + +--- a/hostapd/Makefile ++++ b/hostapd/Makefile +@@ -221,6 +221,9 @@ endif + ifdef CONFIG_NO_CTRL_IFACE + CFLAGS += -DCONFIG_NO_CTRL_IFACE + else ++ifdef CONFIG_CTRL_IFACE_MIB ++CFLAGS += -DCONFIG_CTRL_IFACE_MIB ++endif + ifeq ($(CONFIG_CTRL_IFACE), udp) + CFLAGS += -DCONFIG_CTRL_IFACE_UDP + else +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -3897,6 +3897,7 @@ static int hostapd_ctrl_iface_receive_pr + reply_size); + } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { + reply_len = hostapd_drv_status(hapd, reply, reply_size); ++#ifdef CONFIG_CTRL_IFACE_MIB + } else if (os_strcmp(buf, "MIB") == 0) { + reply_len = ieee802_11_get_mib(hapd, reply, reply_size); + if (reply_len >= 0) { +@@ -3938,6 +3939,7 @@ static int hostapd_ctrl_iface_receive_pr + } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { + reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, + reply_size); ++#endif + } else if (os_strcmp(buf, "ATTACH") == 0) { + if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL)) + reply_len = -1; +--- a/src/ap/ctrl_iface_ap.c ++++ b/src/ap/ctrl_iface_ap.c +@@ -26,6 +26,26 @@ + #include "taxonomy.h" + #include "wnm_ap.h" + ++static const char * hw_mode_str(enum hostapd_hw_mode mode) ++{ ++ switch (mode) { ++ case HOSTAPD_MODE_IEEE80211B: ++ return "b"; ++ case HOSTAPD_MODE_IEEE80211G: ++ return "g"; ++ case HOSTAPD_MODE_IEEE80211A: ++ return "a"; ++ case HOSTAPD_MODE_IEEE80211AD: ++ return "ad"; ++ case HOSTAPD_MODE_IEEE80211ANY: ++ return "any"; ++ case NUM_HOSTAPD_MODES: ++ return "invalid"; ++ } ++ return "unknown"; ++} ++ ++#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) +@@ -212,26 +232,6 @@ static const char * timeout_next_str(int + } + + +-static const char * hw_mode_str(enum hostapd_hw_mode mode) +-{ +- switch (mode) { +- case HOSTAPD_MODE_IEEE80211B: +- return "b"; +- case HOSTAPD_MODE_IEEE80211G: +- return "g"; +- case HOSTAPD_MODE_IEEE80211A: +- return "a"; +- case HOSTAPD_MODE_IEEE80211AD: +- return "ad"; +- case HOSTAPD_MODE_IEEE80211ANY: +- return "any"; +- case NUM_HOSTAPD_MODES: +- return "invalid"; +- } +- return "unknown"; +-} +- +- + static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd, + struct sta_info *sta, + char *buf, size_t buflen) +@@ -539,6 +539,7 @@ int hostapd_ctrl_iface_sta_next(struct h + return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); + } + ++#endif + + #ifdef CONFIG_P2P_MANAGER + static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, +@@ -951,12 +952,12 @@ int hostapd_ctrl_iface_status(struct hos + return len; + len += ret; + } +- ++#ifdef CONFIG_CTRL_IFACE_MIB + if (iface->conf->ieee80211n && !hapd->conf->disable_11n && mode) { + len = hostapd_write_ht_mcs_bitmask(buf, buflen, len, + mode->mcs_set); + } +- ++#endif /* CONFIG_CTRL_IFACE_MIB */ + if (iface->current_rates && iface->num_rates) { + ret = os_snprintf(buf + len, buflen - len, "supported_rates="); + if (os_snprintf_error(buflen - len, ret)) +--- a/src/ap/ieee802_1x.c ++++ b/src/ap/ieee802_1x.c +@@ -2837,6 +2837,7 @@ static const char * bool_txt(bool val) + return val ? "TRUE" : "FALSE"; + } + ++#ifdef CONFIG_CTRL_IFACE_MIB + + int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) + { +@@ -3023,6 +3024,7 @@ int ieee802_1x_get_mib_sta(struct hostap + return len; + } + ++#endif + + #ifdef CONFIG_HS20 + static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) +--- a/src/ap/wpa_auth.c ++++ b/src/ap/wpa_auth.c +@@ -5583,6 +5583,7 @@ static const char * wpa_bool_txt(int val + return val ? "TRUE" : "FALSE"; + } + ++#ifdef CONFIG_CTRL_IFACE_MIB + + #define RSN_SUITE "%02x-%02x-%02x-%d" + #define RSN_SUITE_ARG(s) \ +@@ -5735,7 +5736,7 @@ int wpa_get_mib_sta(struct wpa_state_mac + + return len; + } +- ++#endif + + void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth) + { +--- a/src/rsn_supp/wpa.c ++++ b/src/rsn_supp/wpa.c +@@ -3943,6 +3943,8 @@ static u32 wpa_key_mgmt_suite(struct wpa + } + + ++#ifdef CONFIG_CTRL_IFACE_MIB ++ + #define RSN_SUITE "%02x-%02x-%02x-%d" + #define RSN_SUITE_ARG(s) \ + ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff +@@ -4024,6 +4026,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch + + return (int) len; + } ++#endif + #endif /* CONFIG_CTRL_IFACE */ + + +--- a/wpa_supplicant/Makefile ++++ b/wpa_supplicant/Makefile +@@ -1038,6 +1038,9 @@ ifdef CONFIG_FILS + OBJS += ../src/ap/fils_hlp.o + endif + ifdef CONFIG_CTRL_IFACE ++ifdef CONFIG_CTRL_IFACE_MIB ++CFLAGS += -DCONFIG_CTRL_IFACE_MIB ++endif + OBJS += ../src/ap/ctrl_iface_ap.o + endif + +--- a/wpa_supplicant/ap.c ++++ b/wpa_supplicant/ap.c +@@ -1520,7 +1520,7 @@ int wpas_ap_wps_nfc_report_handover(stru + #endif /* CONFIG_WPS */ + + +-#ifdef CONFIG_CTRL_IFACE ++#if defined(CONFIG_CTRL_IFACE) && defined(CONFIG_CTRL_IFACE_MIB) + + int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s, + char *buf, size_t buflen) +--- a/wpa_supplicant/ctrl_iface.c ++++ b/wpa_supplicant/ctrl_iface.c +@@ -2355,7 +2355,7 @@ static int wpa_supplicant_ctrl_iface_sta + pos += ret; + } + +-#ifdef CONFIG_AP ++#if defined(CONFIG_AP) && defined(CONFIG_CTRL_IFACE_MIB) + if (wpa_s->ap_iface) { + pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, + end - pos, +@@ -12542,6 +12542,7 @@ char * wpa_supplicant_ctrl_iface_process + reply_len = -1; + } else if (os_strncmp(buf, "NOTE ", 5) == 0) { + wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); ++#ifdef CONFIG_CTRL_IFACE_MIB + } else if (os_strcmp(buf, "MIB") == 0) { + reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); + if (reply_len >= 0) { +@@ -12554,6 +12555,7 @@ char * wpa_supplicant_ctrl_iface_process + reply_size - reply_len); + #endif /* CONFIG_MACSEC */ + } ++#endif + } else if (os_strncmp(buf, "STATUS", 6) == 0) { + reply_len = wpa_supplicant_ctrl_iface_status( + wpa_s, buf + 6, reply, reply_size); +@@ -13042,6 +13044,7 @@ char * wpa_supplicant_ctrl_iface_process + reply_len = wpa_supplicant_ctrl_iface_bss( + wpa_s, buf + 4, reply, reply_size); + #ifdef CONFIG_AP ++#ifdef CONFIG_CTRL_IFACE_MIB + } 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) { +@@ -13050,12 +13053,15 @@ char * wpa_supplicant_ctrl_iface_process + } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { + reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, + reply_size); ++#endif ++#ifdef CONFIG_CTRL_IFACE_MIB + } else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) { + if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15)) + reply_len = -1; + } else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) { + if (ap_ctrl_iface_sta_disassociate(wpa_s, buf + 13)) + reply_len = -1; ++#endif + } else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) { + if (ap_ctrl_iface_chanswitch(wpa_s, buf + 12)) + reply_len = -1; diff --git a/package/network/services/hostapd/patches/253-qos_map_set_without_interworking.patch b/package/network/services/hostapd/patches/253-qos_map_set_without_interworking.patch new file mode 100644 index 0000000000..4072ff5664 --- /dev/null +++ b/package/network/services/hostapd/patches/253-qos_map_set_without_interworking.patch @@ -0,0 +1,103 @@ +From: Felix Fietkau +Date: Thu, 4 Nov 2021 11:45:18 +0100 +Subject: [PATCH] hostapd: support qos_map_set without CONFIG_INTERWORKING + +This feature is useful on its own even without full interworking support + +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -1680,6 +1680,8 @@ static int parse_anqp_elem(struct hostap + return 0; + } + ++#endif /* CONFIG_INTERWORKING */ ++ + + static int parse_qos_map_set(struct hostapd_bss_config *bss, + char *buf, int line) +@@ -1721,8 +1723,6 @@ static int parse_qos_map_set(struct host + return 0; + } + +-#endif /* CONFIG_INTERWORKING */ +- + + #ifdef CONFIG_HS20 + static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, +@@ -4260,10 +4260,10 @@ static int hostapd_config_fill(struct ho + bss->gas_frag_limit = val; + } else if (os_strcmp(buf, "gas_comeback_delay") == 0) { + bss->gas_comeback_delay = atoi(pos); ++#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); +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -1548,6 +1548,7 @@ static int hostapd_setup_bss(struct host + 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, +@@ -1555,7 +1556,6 @@ static int hostapd_setup_bss(struct host + 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"); +--- a/src/ap/ieee802_11_shared.c ++++ b/src/ap/ieee802_11_shared.c +@@ -1138,13 +1138,11 @@ u8 * hostapd_eid_rsnxe(struct hostapd_da + 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)); +--- a/wpa_supplicant/events.c ++++ b/wpa_supplicant/events.c +@@ -2935,8 +2935,6 @@ void wnm_bss_keep_alive_deinit(struct wp + } + + +-#ifdef CONFIG_INTERWORKING +- + static int wpas_qos_map_set(struct wpa_supplicant *wpa_s, const u8 *qos_map, + size_t len) + { +@@ -2969,8 +2967,6 @@ static void interworking_process_assoc_r + } + } + +-#endif /* CONFIG_INTERWORKING */ +- + + static void wpa_supplicant_set_4addr_mode(struct wpa_supplicant *wpa_s) + { +@@ -3350,10 +3346,8 @@ static int wpa_supplicant_event_associnf + wnm_process_assoc_resp(wpa_s, data->assoc_info.resp_ies, + data->assoc_info.resp_ies_len); + #endif /* CONFIG_WNM */ +-#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/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch deleted file mode 100644 index c65b2b181e..0000000000 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ /dev/null @@ -1,243 +0,0 @@ -From: Felix Fietkau -Date: Fri, 18 Mar 2011 02:15:52 +0000 -Subject: [PATCH] Remove some unnecessary control interface functionality - ---- a/hostapd/Makefile -+++ b/hostapd/Makefile -@@ -221,6 +221,9 @@ endif - ifdef CONFIG_NO_CTRL_IFACE - CFLAGS += -DCONFIG_NO_CTRL_IFACE - else -+ifdef CONFIG_CTRL_IFACE_MIB -+CFLAGS += -DCONFIG_CTRL_IFACE_MIB -+endif - ifeq ($(CONFIG_CTRL_IFACE), udp) - CFLAGS += -DCONFIG_CTRL_IFACE_UDP - else ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -3897,6 +3897,7 @@ static int hostapd_ctrl_iface_receive_pr - reply_size); - } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { - reply_len = hostapd_drv_status(hapd, reply, reply_size); -+#ifdef CONFIG_CTRL_IFACE_MIB - } else if (os_strcmp(buf, "MIB") == 0) { - reply_len = ieee802_11_get_mib(hapd, reply, reply_size); - if (reply_len >= 0) { -@@ -3938,6 +3939,7 @@ static int hostapd_ctrl_iface_receive_pr - } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { - reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, - reply_size); -+#endif - } else if (os_strcmp(buf, "ATTACH") == 0) { - if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL)) - reply_len = -1; ---- a/src/ap/ctrl_iface_ap.c -+++ b/src/ap/ctrl_iface_ap.c -@@ -26,6 +26,26 @@ - #include "taxonomy.h" - #include "wnm_ap.h" - -+static const char * hw_mode_str(enum hostapd_hw_mode mode) -+{ -+ switch (mode) { -+ case HOSTAPD_MODE_IEEE80211B: -+ return "b"; -+ case HOSTAPD_MODE_IEEE80211G: -+ return "g"; -+ case HOSTAPD_MODE_IEEE80211A: -+ return "a"; -+ case HOSTAPD_MODE_IEEE80211AD: -+ return "ad"; -+ case HOSTAPD_MODE_IEEE80211ANY: -+ return "any"; -+ case NUM_HOSTAPD_MODES: -+ return "invalid"; -+ } -+ return "unknown"; -+} -+ -+#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) -@@ -212,26 +232,6 @@ static const char * timeout_next_str(int - } - - --static const char * hw_mode_str(enum hostapd_hw_mode mode) --{ -- switch (mode) { -- case HOSTAPD_MODE_IEEE80211B: -- return "b"; -- case HOSTAPD_MODE_IEEE80211G: -- return "g"; -- case HOSTAPD_MODE_IEEE80211A: -- return "a"; -- case HOSTAPD_MODE_IEEE80211AD: -- return "ad"; -- case HOSTAPD_MODE_IEEE80211ANY: -- return "any"; -- case NUM_HOSTAPD_MODES: -- return "invalid"; -- } -- return "unknown"; --} -- -- - static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd, - struct sta_info *sta, - char *buf, size_t buflen) -@@ -539,6 +539,7 @@ int hostapd_ctrl_iface_sta_next(struct h - return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); - } - -+#endif - - #ifdef CONFIG_P2P_MANAGER - static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, -@@ -951,12 +952,12 @@ int hostapd_ctrl_iface_status(struct hos - return len; - len += ret; - } -- -+#ifdef CONFIG_CTRL_IFACE_MIB - if (iface->conf->ieee80211n && !hapd->conf->disable_11n && mode) { - len = hostapd_write_ht_mcs_bitmask(buf, buflen, len, - mode->mcs_set); - } -- -+#endif /* CONFIG_CTRL_IFACE_MIB */ - if (iface->current_rates && iface->num_rates) { - ret = os_snprintf(buf + len, buflen - len, "supported_rates="); - if (os_snprintf_error(buflen - len, ret)) ---- a/src/ap/ieee802_1x.c -+++ b/src/ap/ieee802_1x.c -@@ -2837,6 +2837,7 @@ static const char * bool_txt(bool val) - return val ? "TRUE" : "FALSE"; - } - -+#ifdef CONFIG_CTRL_IFACE_MIB - - int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) - { -@@ -3023,6 +3024,7 @@ int ieee802_1x_get_mib_sta(struct hostap - return len; - } - -+#endif - - #ifdef CONFIG_HS20 - static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) ---- a/src/ap/wpa_auth.c -+++ b/src/ap/wpa_auth.c -@@ -5583,6 +5583,7 @@ static const char * wpa_bool_txt(int val - return val ? "TRUE" : "FALSE"; - } - -+#ifdef CONFIG_CTRL_IFACE_MIB - - #define RSN_SUITE "%02x-%02x-%02x-%d" - #define RSN_SUITE_ARG(s) \ -@@ -5735,7 +5736,7 @@ int wpa_get_mib_sta(struct wpa_state_mac - - return len; - } -- -+#endif - - void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth) - { ---- a/src/rsn_supp/wpa.c -+++ b/src/rsn_supp/wpa.c -@@ -3943,6 +3943,8 @@ static u32 wpa_key_mgmt_suite(struct wpa - } - - -+#ifdef CONFIG_CTRL_IFACE_MIB -+ - #define RSN_SUITE "%02x-%02x-%02x-%d" - #define RSN_SUITE_ARG(s) \ - ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -4024,6 +4026,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch - - return (int) len; - } -+#endif - #endif /* CONFIG_CTRL_IFACE */ - - ---- a/wpa_supplicant/Makefile -+++ b/wpa_supplicant/Makefile -@@ -1038,6 +1038,9 @@ ifdef CONFIG_FILS - OBJS += ../src/ap/fils_hlp.o - endif - ifdef CONFIG_CTRL_IFACE -+ifdef CONFIG_CTRL_IFACE_MIB -+CFLAGS += -DCONFIG_CTRL_IFACE_MIB -+endif - OBJS += ../src/ap/ctrl_iface_ap.o - endif - ---- a/wpa_supplicant/ap.c -+++ b/wpa_supplicant/ap.c -@@ -1520,7 +1520,7 @@ int wpas_ap_wps_nfc_report_handover(stru - #endif /* CONFIG_WPS */ - - --#ifdef CONFIG_CTRL_IFACE -+#if defined(CONFIG_CTRL_IFACE) && defined(CONFIG_CTRL_IFACE_MIB) - - int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s, - char *buf, size_t buflen) ---- a/wpa_supplicant/ctrl_iface.c -+++ b/wpa_supplicant/ctrl_iface.c -@@ -2355,7 +2355,7 @@ static int wpa_supplicant_ctrl_iface_sta - pos += ret; - } - --#ifdef CONFIG_AP -+#if defined(CONFIG_AP) && defined(CONFIG_CTRL_IFACE_MIB) - if (wpa_s->ap_iface) { - pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, - end - pos, -@@ -12542,6 +12542,7 @@ char * wpa_supplicant_ctrl_iface_process - reply_len = -1; - } else if (os_strncmp(buf, "NOTE ", 5) == 0) { - wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); -+#ifdef CONFIG_CTRL_IFACE_MIB - } else if (os_strcmp(buf, "MIB") == 0) { - reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); - if (reply_len >= 0) { -@@ -12554,6 +12555,7 @@ char * wpa_supplicant_ctrl_iface_process - reply_size - reply_len); - #endif /* CONFIG_MACSEC */ - } -+#endif - } else if (os_strncmp(buf, "STATUS", 6) == 0) { - reply_len = wpa_supplicant_ctrl_iface_status( - wpa_s, buf + 6, reply, reply_size); -@@ -13042,6 +13044,7 @@ char * wpa_supplicant_ctrl_iface_process - reply_len = wpa_supplicant_ctrl_iface_bss( - wpa_s, buf + 4, reply, reply_size); - #ifdef CONFIG_AP -+#ifdef CONFIG_CTRL_IFACE_MIB - } 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) { -@@ -13050,12 +13053,15 @@ char * wpa_supplicant_ctrl_iface_process - } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { - reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, - reply_size); -+#endif -+#ifdef CONFIG_CTRL_IFACE_MIB - } else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) { - if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15)) - reply_len = -1; - } else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) { - if (ap_ctrl_iface_sta_disassociate(wpa_s, buf + 13)) - reply_len = -1; -+#endif - } else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) { - if (ap_ctrl_iface_chanswitch(wpa_s, buf + 12)) - reply_len = -1; diff --git a/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch b/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch index b7d2e2b659..e68edacb44 100644 --- a/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch +++ b/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch @@ -11,7 +11,7 @@ if CONFIG_CTRL_IFACE_MIB is not defined. --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c -@@ -757,7 +757,7 @@ static int wpa_ctrl_command_sta(struct w +@@ -753,7 +753,7 @@ static int wpa_ctrl_command_sta(struct w } buf[len] = '\0'; diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch deleted file mode 100644 index 006a567c33..0000000000 --- a/package/network/services/hostapd/patches/420-indicate-features.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Jo-Philipp Wich -Date: Mon, 12 Dec 2011 17:26:13 +0000 -Subject: [PATCH] hostapd: support optional argument for the -v switch of - hostapd and wpa_supplicant to query build features, e.g. hostapd -veap to - test whether 802.11i support is compiled in - ---- a/hostapd/main.c -+++ b/hostapd/main.c -@@ -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; -@@ -806,7 +806,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:q"); -+ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::"); - if (c < 0) - break; - switch (c) { -@@ -843,6 +843,8 @@ int main(int argc, char *argv[]) - break; - #endif /* CONFIG_DEBUG_LINUX_TRACING */ - case 'v': -+ if (optarg) -+ exit(!has_feature(optarg)); - show_version(); - exit(1); - case 'g': ---- a/wpa_supplicant/main.c -+++ b/wpa_supplicant/main.c -@@ -12,6 +12,7 @@ - #endif /* __linux__ */ - - #include "common.h" -+#include "build_features.h" - #include "crypto/crypto.h" - #include "fst/fst.h" - #include "wpa_supplicant_i.h" -@@ -202,7 +203,7 @@ int main(int argc, char *argv[]) - - for (;;) { - c = getopt(argc, argv, -- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW"); -+ "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuv::W"); - if (c < 0) - break; - switch (c) { -@@ -302,8 +303,12 @@ int main(int argc, char *argv[]) - break; - #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ - case 'v': -- printf("%s\n", wpa_supplicant_version); -- exitcode = 0; -+ if (optarg) { -+ exitcode = !has_feature(optarg); -+ } else { -+ printf("%s\n", wpa_supplicant_version); -+ exitcode = 0; -+ } - goto out; - case 'W': - params.wait_for_monitor++; diff --git a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch deleted file mode 100644 index b6421e9d75..0000000000 --- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch +++ /dev/null @@ -1,61 +0,0 @@ -From: Felix Fietkau -Date: Thu, 13 Sep 2012 12:39:14 +0000 -Subject: [PATCH] hostapd: support wps in hostapd_cli even when built from the - mini variant - ---- a/hostapd/hostapd_cli.c -+++ b/hostapd/hostapd_cli.c -@@ -401,7 +401,6 @@ static int hostapd_cli_cmd_disassociate( - } - - --#ifdef CONFIG_TAXONOMY - static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc, - char *argv[]) - { -@@ -414,7 +413,6 @@ static int hostapd_cli_cmd_signature(str - os_snprintf(buf, sizeof(buf), "SIGNATURE %s", argv[0]); - return wpa_ctrl_command(ctrl, buf); - } --#endif /* CONFIG_TAXONOMY */ - - - static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc, -@@ -431,7 +429,6 @@ static int hostapd_cli_cmd_sa_query(stru - } - - --#ifdef CONFIG_WPS - static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, - char *argv[]) - { -@@ -657,7 +654,6 @@ static int hostapd_cli_cmd_wps_config(st - ssid_hex, argv[1]); - return wpa_ctrl_command(ctrl, buf); - } --#endif /* CONFIG_WPS */ - - - static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -1670,13 +1666,10 @@ static const struct hostapd_cli_cmd host - { "disassociate", hostapd_cli_cmd_disassociate, - hostapd_complete_stations, - " = disassociate a station" }, --#ifdef CONFIG_TAXONOMY - { "signature", hostapd_cli_cmd_signature, hostapd_complete_stations, - " = get taxonomy signature for a station" }, --#endif /* CONFIG_TAXONOMY */ - { "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations, - " = send SA Query to a station" }, --#ifdef CONFIG_WPS - { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, - " [timeout] [addr] = add WPS Enrollee PIN" }, - { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, -@@ -1701,7 +1694,6 @@ static const struct hostapd_cli_cmd host - " = configure AP" }, - { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, - "= show current WPS status" }, --#endif /* CONFIG_WPS */ - { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, - "= send Disassociation Imminent notification" }, - { "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, diff --git a/package/network/services/hostapd/patches/431-wpa_cli_ifdef.patch b/package/network/services/hostapd/patches/431-wpa_cli_ifdef.patch deleted file mode 100644 index d7f967d779..0000000000 --- a/package/network/services/hostapd/patches/431-wpa_cli_ifdef.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Felix Fietkau -Date: Mon, 2 Dec 2013 13:07:46 +0000 -Subject: [PATCH] hostapd: always include p2p options in wpa_cli - ---- a/wpa_supplicant/wpa_cli.c -+++ b/wpa_supplicant/wpa_cli.c -@@ -26,6 +26,15 @@ - #include - #endif /* ANDROID */ - -+#ifndef CONFIG_P2P -+#define CONFIG_P2P -+#endif -+#ifndef CONFIG_AP -+#define CONFIG_AP -+#endif -+#ifndef CONFIG_MESH -+#define CONFIG_MESH -+#endif - - static const char *const wpa_cli_version = - "wpa_cli v" VERSION_STR "\n" diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index db561b8c20..ac1c9280b7 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -14,15 +14,7 @@ Signed-hostap: Antonio Quartulli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -19,6 +19,7 @@ - - #define WPA_SUPPLICANT_DRIVER_VERSION 4 - -+#include "ap/sta_info.h" - #include "common/defs.h" - #include "common/ieee802_11_defs.h" - #include "common/wpa_common.h" -@@ -971,6 +972,9 @@ struct wpa_driver_associate_params { +@@ -971,6 +971,9 @@ struct wpa_driver_associate_params { * responsible for selecting with which BSS to associate. */ const u8 *bssid; @@ -151,18 +143,7 @@ Signed-hostap: Antonio Quartulli { INT_RANGE(macsec_integ_only, 0, 1) }, --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h -@@ -10,8 +10,10 @@ - #define CONFIG_SSID_H - - #include "common/defs.h" -+#include "ap/sta_info.h" - #include "utils/list.h" - #include "eap_peer/eap_config.h" -+#include "drivers/nl80211_copy.h" - - - #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1) -@@ -879,6 +881,9 @@ struct wpa_ssid { +@@ -879,6 +879,9 @@ struct wpa_ssid { */ void *parent_cred; diff --git a/package/network/services/hostapd/patches/461-Move-definition-of-WLAN_SUPP_RATES_MAX-to-defs.h.patch b/package/network/services/hostapd/patches/461-Move-definition-of-WLAN_SUPP_RATES_MAX-to-defs.h.patch deleted file mode 100644 index daff60a8ad..0000000000 --- a/package/network/services/hostapd/patches/461-Move-definition-of-WLAN_SUPP_RATES_MAX-to-defs.h.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Eneas U de Queiroz -Date: Mon, 12 Feb 2024 14:18:24 -0300 -Subject: [PATCH] Move definition of WLAN_SUPP_RATES_MAX to defs.h - -Patch 460-wpa_supplicant-add-new-config-params-to-be-used-with.patch -("wpa_supplicant: add new config params to be used with the ibss join -command") adds the definition of unsigned char -rates[WLAN_SUPP_RATES_MAX] to driver.h, which needs to have -WLAN_SUPP_RATES_MAX defined. So it includes sta_info.h to get the -definition. - -Commit c74739250a ("AP MLD: Use a helper function to check if a STA is a -non-AP MLD") makes sta_info.h include driver.h before -it defines WLAN_SUPP_RATES_MAX, causing an error: - -src/drivers/driver.h:969:29: error: 'WLAN_SUPP_RATES_MAX' undeclared here (not in a function) - -Move the definition of WLAN_SUPP_RATES_MAX to defs.h to ensure it gets -defined before other headers are included. The inclusion of sta_info.h -in driver.h can be reverted as well. - -Signed-off-by: Eneas U de Queiroz ---- - src/ap/sta_info.h | 4 ---- - src/common/defs.h | 4 ++++ - src/drivers/driver.h | 1 - - wpa_supplicant/config_ssid.h | 1 - - 4 files changed, 4 insertions(+), 6 deletions(-) - ---- a/src/ap/sta_info.h -+++ b/src/ap/sta_info.h -@@ -49,10 +49,6 @@ - #define WLAN_STA_PENDING_DEAUTH_CB BIT(30) - #define WLAN_STA_NONERP BIT(31) - --/* Maximum number of supported rates (from both Supported Rates and Extended -- * Supported Rates IEs). */ --#define WLAN_SUPP_RATES_MAX 32 -- - struct hostapd_data; - - struct mbo_non_pref_chan_info { ---- a/src/common/defs.h -+++ b/src/common/defs.h -@@ -63,6 +63,10 @@ - WPA_KEY_MGMT_FT_FILS_SHA256 | \ - WPA_KEY_MGMT_FT_FILS_SHA384) - -+/* Maximum number of supported rates (from both Supported Rates and Extended -+ * Supported Rates IEs). */ -+#define WLAN_SUPP_RATES_MAX 32 -+ - static inline int wpa_key_mgmt_wpa_ieee8021x(int akm) - { - return !!(akm & (WPA_KEY_MGMT_IEEE8021X | ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -19,7 +19,6 @@ - - #define WPA_SUPPLICANT_DRIVER_VERSION 4 - --#include "ap/sta_info.h" - #include "common/defs.h" - #include "common/ieee802_11_defs.h" - #include "common/wpa_common.h" ---- a/wpa_supplicant/config_ssid.h -+++ b/wpa_supplicant/config_ssid.h -@@ -10,7 +10,6 @@ - #define CONFIG_SSID_H - - #include "common/defs.h" --#include "ap/sta_info.h" - #include "utils/list.h" - #include "eap_peer/eap_config.h" - #include "drivers/nl80211_copy.h" diff --git a/package/network/services/hostapd/patches/500-lto-jobserver-support.patch b/package/network/services/hostapd/patches/500-lto-jobserver-support.patch deleted file mode 100644 index f7f071fb0e..0000000000 --- a/package/network/services/hostapd/patches/500-lto-jobserver-support.patch +++ /dev/null @@ -1,64 +0,0 @@ -From: Felix Fietkau -Date: Tue, 10 Jul 2018 13:48:17 +0200 -Subject: [PATCH] hostapd: build with LTO enabled (using jobserver for parallel - build) - ---- a/hostapd/Makefile -+++ b/hostapd/Makefile -@@ -1408,7 +1408,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) - @$(AR) cr $@ hostapd_multi.o $(OBJS) - - hostapd: $(OBJS) -- $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) -+ +$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) - @$(E) " LD " $@ - - ifdef CONFIG_WPA_TRACE -@@ -1419,7 +1419,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) - @$(E) " LD " $@ - - NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) ---- a/wpa_supplicant/Makefile -+++ b/wpa_supplicant/Makefile -@@ -2106,31 +2106,31 @@ wpa_supplicant_multi.a: .config $(BCHECK - @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) - - wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) -- $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) -+ +$(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) - @$(E) " LD " $@ - - LIBCTRL += ../src/common/wpa_ctrl.o diff --git a/package/network/services/hostapd/patches/599-wpa_supplicant-fix-warnings.patch b/package/network/services/hostapd/patches/599-wpa_supplicant-fix-warnings.patch deleted file mode 100644 index 4acd7cafe2..0000000000 --- a/package/network/services/hostapd/patches/599-wpa_supplicant-fix-warnings.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: "Leon M. George" -Date: Wed, 11 Sep 2019 15:22:55 +0200 -Subject: [PATCH] hostapd: declare struct wpa_bss early - -wps_supplicant.h assumes that 'struct wpa_bss' is forward declared if -CONFIG_WPS is not defined. With the later inclusion of -600-ubus_support, the issue manifests in warnings like these: - -wps_supplicant.h:113:15: warning: 'struct wpa_bss' declared inside parameter list will not be visible outside of this definition or declaration - struct wpa_bss *bss) - ^~~~~~~ -This patch forward declares 'struct wpa_bss' regardless. - ---- a/wpa_supplicant/wps_supplicant.h -+++ b/wpa_supplicant/wps_supplicant.h -@@ -9,6 +9,7 @@ - #ifndef WPS_SUPPLICANT_H - #define WPS_SUPPLICANT_H - -+struct wpa_bss; - struct wpa_scan_results; - - #ifdef CONFIG_WPS -@@ -16,8 +17,6 @@ struct wpa_scan_results; - #include "wps/wps.h" - #include "wps/wps_defs.h" - --struct wpa_bss; -- - struct wps_new_ap_settings { - const char *ssid_hex; - const char *auth; diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index a6b03ffd3f..0457f37f74 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -314,7 +314,7 @@ probe/assoc/auth requests via object subscribe. ap_free_sta(hapd, sta); break; } -@@ -1451,15 +1453,28 @@ void ap_sta_set_authorized_event(struct +@@ -1448,15 +1450,28 @@ void ap_sta_set_authorized_event(struct os_snprintf(buf, sizeof(buf), MACSTR, MAC2STR(sta->addr)); if (authorized) { @@ -343,7 +343,7 @@ probe/assoc/auth requests via object subscribe. #ifdef CONFIG_P2P if (wpa_auth_get_ip_addr(sta->wpa_sm, ip_addr_buf) == 0) { os_snprintf(ip_addr, sizeof(ip_addr), -@@ -1470,6 +1485,13 @@ void ap_sta_set_authorized_event(struct +@@ -1467,6 +1482,13 @@ void ap_sta_set_authorized_event(struct } #endif /* CONFIG_P2P */ @@ -357,7 +357,7 @@ probe/assoc/auth requests via object subscribe. keyid = ap_sta_wpa_get_keyid(hapd, sta); if (keyid) { os_snprintf(keyid_buf, sizeof(keyid_buf), -@@ -1488,17 +1510,19 @@ void ap_sta_set_authorized_event(struct +@@ -1485,17 +1507,19 @@ void ap_sta_set_authorized_event(struct dpp_pkhash, SHA256_MAC_LEN); } diff --git a/package/network/services/hostapd/patches/601-ucode_support.patch b/package/network/services/hostapd/patches/601-ucode_support.patch index bc50606038..b826363248 100644 --- a/package/network/services/hostapd/patches/601-ucode_support.patch +++ b/package/network/services/hostapd/patches/601-ucode_support.patch @@ -206,7 +206,7 @@ as adding/removing interfaces. void hostapd_interface_deinit_free(struct hostapd_iface *iface); --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -3853,6 +3853,25 @@ struct wpa_driver_ops { +@@ -3856,6 +3856,25 @@ struct wpa_driver_ops { const char *ifname); /** @@ -232,7 +232,7 @@ as adding/removing interfaces. * set_sta_vlan - Bind a station into a specific interface (AP only) * @priv: Private driver interface data * @ifname: Interface (main or virtual BSS or VLAN) -@@ -6507,6 +6526,7 @@ union wpa_event_data { +@@ -6510,6 +6529,7 @@ union wpa_event_data { /** * struct ch_switch @@ -240,7 +240,7 @@ as adding/removing interfaces. * @freq: Frequency of new channel in MHz * @ht_enabled: Whether this is an HT channel * @ch_offset: Secondary channel offset -@@ -6517,6 +6537,7 @@ union wpa_event_data { +@@ -6520,6 +6540,7 @@ union wpa_event_data { * @punct_bitmap: Puncturing bitmap */ struct ch_switch { @@ -596,7 +596,7 @@ as adding/removing interfaces. CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -5955,6 +5955,7 @@ void supplicant_event(void *ctx, enum wp +@@ -5949,6 +5949,7 @@ void supplicant_event(void *ctx, enum wp event_to_string(event), event); #endif /* CONFIG_NO_STDOUT_DEBUG */ diff --git a/package/network/services/hostapd/patches/740-snoop_iface.patch b/package/network/services/hostapd/patches/740-snoop_iface.patch index 5611096ad8..f4b3ac33b1 100644 --- a/package/network/services/hostapd/patches/740-snoop_iface.patch +++ b/package/network/services/hostapd/patches/740-snoop_iface.patch @@ -112,7 +112,7 @@ untagged DHCP packets hapd->x_snoop_initialized = false; --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -4275,7 +4275,7 @@ struct wpa_driver_ops { +@@ -4278,7 +4278,7 @@ struct wpa_driver_ops { * Returns: 0 on success, negative (<0) on failure */ int (*br_set_net_param)(void *priv, enum drv_br_net_param param, diff --git a/package/network/services/hostapd/patches/750-qos_map_set_without_interworking.patch b/package/network/services/hostapd/patches/750-qos_map_set_without_interworking.patch deleted file mode 100644 index 23b8dffb57..0000000000 --- a/package/network/services/hostapd/patches/750-qos_map_set_without_interworking.patch +++ /dev/null @@ -1,103 +0,0 @@ -From: Felix Fietkau -Date: Thu, 4 Nov 2021 11:45:18 +0100 -Subject: [PATCH] hostapd: support qos_map_set without CONFIG_INTERWORKING - -This feature is useful on its own even without full interworking support - ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -1680,6 +1680,8 @@ static int parse_anqp_elem(struct hostap - return 0; - } - -+#endif /* CONFIG_INTERWORKING */ -+ - - static int parse_qos_map_set(struct hostapd_bss_config *bss, - char *buf, int line) -@@ -1721,8 +1723,6 @@ static int parse_qos_map_set(struct host - return 0; - } - --#endif /* CONFIG_INTERWORKING */ -- - - #ifdef CONFIG_HS20 - static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf, -@@ -4282,10 +4282,10 @@ static int hostapd_config_fill(struct ho - bss->gas_frag_limit = val; - } else if (os_strcmp(buf, "gas_comeback_delay") == 0) { - bss->gas_comeback_delay = atoi(pos); -+#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); ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -1578,6 +1578,7 @@ int hostapd_setup_bss(struct hostapd_dat - 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, -@@ -1585,7 +1586,6 @@ int hostapd_setup_bss(struct hostapd_dat - 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"); ---- a/src/ap/ieee802_11_shared.c -+++ b/src/ap/ieee802_11_shared.c -@@ -1138,13 +1138,11 @@ u8 * hostapd_eid_rsnxe(struct hostapd_da - 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)); ---- a/wpa_supplicant/events.c -+++ b/wpa_supplicant/events.c -@@ -2935,8 +2935,6 @@ void wnm_bss_keep_alive_deinit(struct wp - } - - --#ifdef CONFIG_INTERWORKING -- - static int wpas_qos_map_set(struct wpa_supplicant *wpa_s, const u8 *qos_map, - size_t len) - { -@@ -2969,8 +2967,6 @@ static void interworking_process_assoc_r - } - } - --#endif /* CONFIG_INTERWORKING */ -- - - static void wpa_supplicant_set_4addr_mode(struct wpa_supplicant *wpa_s) - { -@@ -3350,10 +3346,8 @@ static int wpa_supplicant_event_associnf - wnm_process_assoc_resp(wpa_s, data->assoc_info.resp_ies, - data->assoc_info.resp_ies_len); - #endif /* CONFIG_WNM */ --#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/package/network/services/hostapd/patches/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch b/package/network/services/hostapd/patches/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch deleted file mode 100644 index b57550ac8b..0000000000 --- a/package/network/services/hostapd/patches/990-ctrl-make-WNM_AP-functions-dependant-on-CONFIG_AP.patch +++ /dev/null @@ -1,33 +0,0 @@ -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(-) - ---- a/wpa_supplicant/ctrl_iface.c -+++ b/wpa_supplicant/ctrl_iface.c -@@ -13220,7 +13220,7 @@ char * wpa_supplicant_ctrl_iface_process - 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; -@@ -13230,7 +13230,7 @@ char * wpa_supplicant_ctrl_iface_process - } 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) { diff --git a/package/network/services/hostapd/patches/991-Fix-OpenWrt-13156.patch b/package/network/services/hostapd/patches/991-Fix-OpenWrt-13156.patch deleted file mode 100644 index 4cd8eaa4d9..0000000000 --- a/package/network/services/hostapd/patches/991-Fix-OpenWrt-13156.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 26cd9bafc1d25e602952ee86cd2a5b8c3a995490 Mon Sep 17 00:00:00 2001 -From: Stijn Tintel -Date: Fri, 28 Jul 2023 16:27:47 +0300 -Subject: [PATCH] Revert "Do prune_association only after the STA is - authorized" - -Commit e978072baaca ("Do prune_association only after the STA is -authorized") causes issues when an STA roams from one interface to -another interface on the same PHY. The mt7915 driver is not able to -handle this properly. While the commits fixes a DoS, there are other -devices and drivers with the same limitation, so revert to the orginal -behavior for now, until we have a better solution in place. - -Ref: https://github.com/openwrt/openwrt/issues/13156 -Signed-off-by: Stijn Tintel ---- - src/ap/hostapd.c | 14 +++++++++++--- - src/ap/sta_info.c | 3 --- - 2 files changed, 11 insertions(+), 6 deletions(-) - ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -3681,6 +3681,8 @@ int hostapd_remove_iface(struct hapd_int - void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, - int reassoc) - { -+ int mld_assoc_link_id = -1; -+ - if (hapd->tkip_countermeasures) { - hostapd_drv_sta_deauth(hapd, sta->addr, - WLAN_REASON_MICHAEL_MIC_FAILURE); -@@ -3688,10 +3690,16 @@ void hostapd_new_assoc_sta(struct hostap - } - - #ifdef CONFIG_IEEE80211BE -- if (ap_sta_is_mld(hapd, sta) && -- sta->mld_assoc_link_id != hapd->mld_link_id) -- return; -+ if (ap_sta_is_mld(hapd, sta)) { -+ if (sta->mld_assoc_link_id == hapd->mld_link_id) { -+ mld_assoc_link_id = sta->mld_assoc_link_id; -+ } else { -+ return; -+ } -+ } - #endif /* CONFIG_IEEE80211BE */ -+ if (mld_assoc_link_id != -2) -+ hostapd_prune_associations(hapd, sta->addr, mld_assoc_link_id); - - ap_sta_clear_disconnect_timeouts(hapd, sta); - sta->post_csa_sa_query = 0; ---- a/src/ap/sta_info.c -+++ b/src/ap/sta_info.c -@@ -1414,9 +1414,6 @@ bool ap_sta_set_authorized_flag(struct h - mld_assoc_link_id = -2; - } - #endif /* CONFIG_IEEE80211BE */ -- if (mld_assoc_link_id != -2) -- hostapd_prune_associations(hapd, sta->addr, -- mld_assoc_link_id); - sta->flags |= WLAN_STA_AUTHORIZED; - } else { - sta->flags &= ~WLAN_STA_AUTHORIZED; diff --git a/package/network/services/hostapd/patches/992-nl80211-add-extra-ies-only-if-allowed-by-driver.patch b/package/network/services/hostapd/patches/992-nl80211-add-extra-ies-only-if-allowed-by-driver.patch deleted file mode 100644 index ca17791d84..0000000000 --- a/package/network/services/hostapd/patches/992-nl80211-add-extra-ies-only-if-allowed-by-driver.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: David Bauer -To: hostap@lists.infradead.org -Cc: =?utf-8?q?=C3=89tienne_Morice?= -Subject: [PATCH] nl80211: add extra-ies only if allowed by driver -Date: Sun, 30 Jan 2022 20:22:00 +0100 -Message-Id: <20220130192200.10883-1-mail@david-bauer.net> -List-Id: - -Upgrading wpa_supplicant from 2.9 to 2.10 breaks broadcom-wl -based adapters. The reason for it is hostapd tries to install additional -IEs for scanning while the driver does not support this. - -The kernel indicates the maximum number of bytes for additional scan IEs -using the NL80211_ATTR_MAX_SCAN_IE_LEN attribute. Save this value and -only add additional scan IEs in case the driver can accommodate these -additional IEs. - -Reported-by: Étienne Morice -Tested-by: Étienne Morice -Signed-off-by: David Bauer ---- - src/drivers/driver.h | 3 +++ - src/drivers/driver_nl80211_capa.c | 4 ++++ - src/drivers/driver_nl80211_scan.c | 2 +- - 3 files changed, 8 insertions(+), 1 deletion(-) - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -2344,6 +2344,9 @@ struct wpa_driver_capa { - /** Maximum number of iterations in a single scan plan */ - u32 max_sched_scan_plan_iterations; - -+ /** Maximum number of extra IE bytes for scans */ -+ u16 max_scan_ie_len; -+ - /** Whether sched_scan (offloaded scanning) is supported */ - int sched_scan_supported; - ---- a/src/drivers/driver_nl80211_capa.c -+++ b/src/drivers/driver_nl80211_capa.c -@@ -972,6 +972,10 @@ static int wiphy_info_handler(struct nl_ - nla_get_u32(tb[NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS]); - } - -+ if (tb[NL80211_ATTR_MAX_SCAN_IE_LEN]) -+ capa->max_scan_ie_len = -+ nla_get_u16(tb[NL80211_ATTR_MAX_SCAN_IE_LEN]); -+ - if (tb[NL80211_ATTR_MAX_MATCH_SETS]) - capa->max_match_sets = - nla_get_u8(tb[NL80211_ATTR_MAX_MATCH_SETS]); ---- a/src/drivers/driver_nl80211_scan.c -+++ b/src/drivers/driver_nl80211_scan.c -@@ -221,7 +221,7 @@ nl80211_scan_common(struct i802_bss *bss - wpa_printf(MSG_DEBUG, "nl80211: Passive scan requested"); - } - -- if (params->extra_ies) { -+ if (params->extra_ies && drv->capa.max_scan_ie_len >= params->extra_ies_len) { - wpa_hexdump(MSG_MSGDUMP, "nl80211: Scan extra IEs", - params->extra_ies, params->extra_ies_len); - if (nla_put(msg, NL80211_ATTR_IE, params->extra_ies_len,