Commit graph

779 commits

Author SHA1 Message Date
Felix Fietkau
d924a0cff8 hostapd: fix a use-after-free bug when interfaces are removed during a scan
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Whenever the first bss is removed, any pending scan still keeps a reference
to it. Cancel it in order to prevent use-after-free bugs.

Reported-by: Chad Monroe <chad.monroe@adtran.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-21 10:24:16 +02:00
Felix Fietkau
0535d615f6 hostapd: increase netlink buffer size
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
When lots of events are waiting to be received, the default buffer size
is not enough, and hostapd can run into "No buffer space available" on
recvmsg. This will cause the netdev state tracking to go out of sync.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-18 21:59:36 +02:00
Felix Fietkau
7b2c9f6799 hostapd: skip dynamic reconfiguration while not in enabled state
Interface might be down or scanning. Better do a full restart in order to avoid
messing up the runtime state.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-05 10:49:58 +02:00
Felix Fietkau
d32e051b69 wpa_supplicant: report interface events and support querying interface status
Makes information like Multi-AP status (including VLAN ID) accessible

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-01 10:08:54 +02:00
Felix Fietkau
f6fd18eb60 wpa_supplicant: include multi-ap status in interface state
This can be used to read the Multi-AP profile and default VLAN ID

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-01 10:08:54 +02:00
Felix Fietkau
5e7113b3db wpa_supplicant: do not wait for notify completion
There is no callback, so no use tracking the request status.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-01 10:08:54 +02:00
Felix Fietkau
1a79345b5d hostapd: skip add call on already present MLD interfaces
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Avoid tearing down running interfaces

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-30 16:44:20 +02:00
Felix Fietkau
0f56141c6c hostapd: add new ubus method for performig channel switch
This is a replacement for the bss based function, which cannot be used for MLO.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-29 13:41:06 +02:00
Felix Fietkau
973cfbadf5 hostapd: fix condition for re-creating MLD interfaces
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Check the correct interface in order to avoid tearing down an existing
itnerface.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-29 12:37:02 +02:00
Felix Fietkau
e0a0d69a63 wpa_supplicant: MLO bringup order
Do not allow hostapd phy state update to bring up links as long between mld_set
and mld_start calls. Configuration on other PHYs could still be pending.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-29 12:37:02 +02:00
Felix Fietkau
80d73707b0 hostapd: fix an AP+STA corner case on MLO APs
Bring up AP interfaces, even if no frequency update was provided.
Fixes bringup when a MLO STA on the same radios connects to fewer links
than available, or to a non-MLD AP.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-29 12:37:02 +02:00
Felix Fietkau
84ea336097 wpa_supplicant: fix ap+sta regression for non-MLD interfaces
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Fix a copy&paste issue.

Reported-by: Chad Monroe <chad.monroe@adtran.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-26 09:30:21 +02:00
Felix Fietkau
adb1ce158a hostapd: fix setting up MLD AP interfaces after config change
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Removing the last remaining link from an MLD AP interface removes the
interface as well. Re-create the interface if necessary on config changes.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-25 12:08:52 +02:00
Felix Fietkau
8c37f5f2f2 wpa_supplicant: fix getting phy status and setting state for MLD
Fixes some AP+STA related issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-25 12:08:52 +02:00
Felix Fietkau
9aca8a97d7 wpa_supplicant: add MLO client support
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Can also be used for a client mode interface that is able to connect on
multiple bands individually, while handling hostapd state for the correct
band.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-24 13:45:59 +02:00
Felix Fietkau
5170a2448c wpa_supplicant: initialize interface list on startup
Avoid errors on deref if adding an interface fails

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-24 13:45:40 +02:00
Felix Fietkau
6834c19e41 hostapd: add wpa_supplicant ubus function guard exception handler
Improves logging when something goes wrong

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-24 13:45:40 +02:00
Felix Fietkau
7aa6ea9cc1 hostapd: ubus: replace ex_wrap exception handler function with global guard
Simplifies the code

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-24 13:45:40 +02:00
Felix Fietkau
9c895bacfb hostapd: fix wds ap on single-wiphy devices
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Ensure events are passed to the right interface

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-27 10:29:21 +02:00
Felix Fietkau
95c8b385e5 hostapd: update to Git HEAD (2025-08-26)
33fb6c738bc4 P2P2: Enable some testing parameters without CONFIG_TESTING_OPTIONS
56616c4183a6 P2P2: Update device name with USD device found
1d791939dcdf Cancel pending connect radio work when network is removed
8235e21d7fe3 P2P: Fix preferred frequency list size handling in p2p_check_pref_chan()
4bc754d9c727 Add QCA vendor interface to enable/disable TX power limit
d65f5705df98 Add QCA vendor attribute to disable A-MSDU address check validation
74881765b7fb nl80211: Use i802_bss in qca_set_allowed_ap_freqs() to use correct ifindex
ca8303135cbb P2P2: Set P2P mode to the driver on P2P GO device
063ae7af68dc ACS: Fix incorrect index calculation for primary channel
4aa3a58377c1 ACS: Validate all channels in a segment before selection
02c9d3376224 ACS: Extend support to exclude 6 GHz non-PSC in non-offloaded ACS
307365eb57bb tests: Add test for ACS exclude 6 GHz non-PSC
0721e4886316 Add QCA vendor attribute to configure EHT RTWT support
76b39db44c77 QCA vendor attribute to configure BTM MLD Recommendation For Multiple APs support
2faeffdeca22 AP MLD: Properly deinit sm of non-ML STA connected to ML AP
e4f4e5a872a5 AP MLD: Fix STA's flag wrongly updated in SME-in-driver cases
ec6cade42c0f Increase buffer size to handle long freq_list entries in config
0522585da7b0 Write freq_list as per-network item in wpa_supplicant.conf
5e527704b912 Use SCS reconfiguration logic under CONFIG_NO_ROBUST_AV
5d6214a724c1 PASN: Clear driver/firwmare ranging context if PASN Auth 1 fails
14dc782d50db DPP: Avoid generating DPP shared secret(z) for non-association links
40326b60b17a RSNO: Allow OWE to be configured in RSN overrides in AP processing
acadef1b04d5 hostapd_cli: Open a new hostapd connection on ping failure when using -a
ac0d9bd80ec5 Add QCA vendor attributes to configure global TX chain mask
f5b8ef6c966a Add QCA vendor attributes for MSDU TX statistics
6c11fcefe4fc hostapd: Prevent blocking sends on control interface monitor socket
0bbb8a66f64c AP MLD: Remove redundant outer loop in hostapd_notif_disassoc_mld()
52fb5ccd91f3 AP MLD: Avoid using mld_id to identify partners
7bb930d50b5f wpa_supplicant: Add option to disable 80+80 MHz opclass advertisement
9001059bd6ad tests: Make dbus_connect_oom more robust
663fb1940231 AP MLD: Fix hostapd_is_mld_ap() check
590f3bdb4c61 AP MLD: Rename hostapd_is_mld_ap() to hostapd_is_multiple_link_mld()
b13b69a235f7 Add VLANID in the AP-STA-CONNECTED events
c1e8b1c6462b SAE: Assign VLAN when using PMKSA caching
9bc29dcdfdee SAE: Default password binding through control interface
9de127c31c40 tests: More testing coverage for SAE with multiple passwords
5ce1d4180386 nl80211: Fix crash by cancelling scan timeout before a BSS is removed
ca266cc24d87 nl80211: Fix crash by setting the drv->ctx properly

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-27 10:29:21 +02:00
Felix Fietkau
5bdb7a5990 wifi-scripts: fix reload handling with random macaddr
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Allow initially generated MAC address to be preserved across reload

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-26 11:53:50 +02:00
Felix Fietkau
d5fa130113 hostapd: fix link address of secondary MLO interfaces
Ensure that hapd->own_addr is set based on the configured bssid

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-26 11:53:50 +02:00
Felix Fietkau
3aee42001f wifi-scripts: add modular wps button handler scripts
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Execute scripts in /etc/rc.wps until one of them returns a exit code of 0.
Split up sta and ap handling of wps into separate scripts.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-08 18:53:30 +02:00
Felix Fietkau
a2c361c520 hostapd: add missing MLO check on ucode bss stop
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Fixes a crash on some config reload types

Fixes: 816c2d86e7 ("hostapd: add support for MLO interfaces in ucode")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-03 06:50:42 +02:00
Felix Fietkau
3786d15561 hostapd: fix bss config reload while in DFS state
Only start a BSS after a config change if it was started before.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-02 16:46:59 +02:00
Felix Fietkau
816c2d86e7 hostapd: add support for MLO interfaces in ucode
MLO interface config is provided in a separate ubus call before
adding regular per-phy interfaces.
Preparation for full MLO support.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-02 16:46:59 +02:00
Felix Fietkau
be2916b1d4 hostapd: remove unnecessary ucv_gc calls
They should not be needed, since the code doesn't use circular references

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-02 16:46:59 +02:00
Felix Fietkau
bcd3d62834 hostapd: maintain ucode hostapd.bss list per interface
Preparation for MLO support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-02 16:46:59 +02:00
Christian Korber
682de550a0 hostapd: fix logging of configuration content
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
As discussed in openwrt#17517, there are contents of hostapd's configuration file logged in syslog.
This includes critical information like `passphrase`. To circumvent this condition,
this commit logs only "inline" if config_fname is inline data.

Otherwise the upstream logic of hostapd applies.

Fixes: openwrt#14049

Signed-off-by: Christian Korber <ck@dev.tdt.de>
Link: https://github.com/openwrt/openwrt/pull/17718
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-01 22:14:08 +02:00
Felix Fietkau
db763342af hostapd: ignore comment lines for hash comparison
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Fixes spurious unnecessary bss restarts

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-07-09 12:14:30 +02:00
Felix Fietkau
a7ab0d5bff hostapd: enable CONFIG_OCV when 802.11be support is enabled
The 802.11be supoort code unconditionally calls ocv related functions

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-07-07 17:16:23 +02:00
Felix Fietkau
bb279e1a69 hostapd: revert a broken upstream patch that was breaking multi-band operation
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
nl80211 events were propagated to the wrong interfaces

Fixes: 2ac791e87d ("hostapd: update to version 2025-06-27")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-07-06 18:47:41 +02:00
Agustin Lorenzo
2ac791e87d hostapd: update to version 2025-06-27
Manually refreshed:

140-tests-Makefile-make-run-tests-with-CONFIG_TLS.patch
601-ucode_support.patch

Fixed in upstream:

804-hostapd-revert-ACS-Validate-6-GHz-AP-criteria-before.patch [1]

Automatically rebased all other patches.

[1] https://w1.fi/cgit/hostap/commit/?id=0b60826a66885bffa2fd709ed5e48cd5fe241b6b

Signed-off-by: Agustin Lorenzo <agustin.lorenzo@thinco.es>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-07-05 14:41:57 +02:00
Felix Fietkau
39580b1d7b hostapd: disable 802.11be support in the mini variant
802.11be capable platforms are big enough to not need the mini variant,
and removing it here saves space for other other devices.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-07-05 14:41:00 +02:00
Felix Fietkau
6e1d4afa86 hostapd: fix potential double free in ubus code
Ensure that the object name is never freed twice

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-07-05 14:41:00 +02:00
Felix Fietkau
f940f7c1ac hostapd: preserve vif radio mask for extra bss interfaces
Fixes status information and scanning on extra BSS interfaces when operating
on multi-radio devices.

Reported-by: Chad Monroe <chad.monroe@adtran.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-06-23 11:23:12 +02:00
Felix Fietkau
9850052190 hostapd: fix generating own neighbor report for dynamically added/changed interfaces
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
hostapd_neighbor_set_own_report is normally called from interface setup only.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-06-20 14:57:35 +02:00
Felix Fietkau
3ebf110711 hostapd: fix dealing with mac address changes for the primary BSS
Ensure that hapd->own_addr is set properly, since hostapd_setup_bss
only handles it for secondary BSS interfaces

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-06-20 14:57:35 +02:00
Felix Fietkau
ed26185bf6 hostapd: tweak ACS retry behavior
When running ACS on multi-radio devices, ACS on one band can block another.
Increase the number of retries and prevent bouncing interfaces between AP
and STA mode during attempts.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-05-31 16:22:48 +02:00
Agustin Lorenzo
93e944648b hostapd: revert "ACS: Validate 6 GHz AP criteria before ACS"
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
By OpenWrt's design, hostapd runs in a single global instance for all radios supported by the device, rather than one instance per radio like hostapd usually does.

Signed-off-by: Agustin Lorenzo <agustin.lorenzo@thinco.es>
Link: https://github.com/openwrt/openwrt/pull/18426
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-29 11:34:48 +02:00
Agustin Lorenzo
70505e0e51 hostapd: update to version 2025-05-23
Manually refreshed:

301-mesh-noscan.patch
601-ucode_support.patch
770-radius_server.patch

Automatically rebased all other patches.

Signed-off-by: Agustin Lorenzo <agustin.lorenzo@thinco.es>
Link: https://github.com/openwrt/openwrt/pull/18426
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-29 11:34:48 +02:00
Mieczyslaw Nalewaj
a238170e57 treewide: strip trailing whitespace
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Strip trailing whitespace in all code:
find . -type f | grep "\.c$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.h$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dts$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dtsi$" | xargs sed -i 's/[ \t]\+$//'

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18626
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-05-20 00:47:37 +02:00
Gustavo Bertoli
ba6aacd2b8 hostapd: Enable DPPv2 support for OpenSSL and mbedtls
Enable Device Provisioning Protocol (DPPv2) in hostapd
for the "full" build-variants.

DPPv2 currently does not compile with WolfSSL due to
missing PKCS7 and certificate support.

Link: https://github.com/openwrt/openwrt/pull/18485

Signed-off-by: Gustavo Bertoli <gubertoli@gmail.com>
2025-05-10 21:42:38 +02:00
Dávid Benko
939628f6b8 hostapd/RADIUS_server: enhance logging
Currently, logging level of the RADIUS server is a constant corresponding
to the highest verbosity (EXCESSIVE, ALL), but when running as a system
service, the output is discarded.

This commit makes logging verbosity configurable by `log_level` option
and redirects all logs to `logd`. Possible levels are defined in hostap
sources:
https://w1.fi/cgit/hostap/tree/src/utils/wpa_debug.h?id=012a893c469157d5734f6f33953497ea6e3b0169#n23
Their reference is inlined in `radius.config` file.

Default value for logging verbosity is INFO (even if the `-l` flag isn't
specified).

Signed-off-by: Dávid Benko <davidbenko@davidbenko.dev>
Link: https://github.com/openwrt/openwrt/pull/18089
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-03-12 13:12:12 +01:00
Dávid Benko
dbdd84725d hostapd/RADIUS_server: add config option for IPv6
Even though IPv6 support for hostapd RADIUS server is implemented
(flag `-6`), it's not possible to enable it from configuration.

This commit adds this option and adapts init script.

Signed-off-by: Dávid Benko <davidbenko@davidbenko.dev>
Link: https://github.com/openwrt/openwrt/pull/18089
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-03-12 13:12:12 +01:00
Felix Fietkau
46c17c22cd hostapd: add missing #ifdef to fix compile error when 802.11be support is disabled
Fixes: d65d546bce ("hostapd: add missing ctrl socket initialization on bss add")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-03-05 09:19:37 +01:00
Felix Fietkau
d65d546bce hostapd: add missing ctrl socket initialization on bss add
Fixes adding/removing individual bss interfaces

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-03-05 08:03:00 +01:00
Matthew Cather
6a10da2934 hostapd: get reference to object before removal
`ucv_array_set` releases the array's reference to the object being cleared.
If this is the last reference to the object, it will be freed, making our
pointer `val` invalid.

To avoid this, we need to obtain our own reference to the object so we
can safely return `val`.

Signed-off-by: Matthew Cather <mattbob4@gmail.com>
2025-03-05 08:03:00 +01:00
Matthew Cather
7729f96093 hostapd: consistent reference counting for registry
Since `wpa_ucode_registry_add` collects its own reference to the values added, the
two functions `hostapd_ucode_bss_get_uval` and `hostapd_ucode_iface_get_uval` would
sometimes return a referenced object (from `uc_resource_new`) and sometimes return
an unreferenced object (from `wpa_ucode_registry_get`). Now, both functions always
return a referenced object.

This change also indirectly fixes `hostapd_ucode_bss_get_uval`, ensuring it now
always returns a referenced object.

Signed-off-by: Matthew Cather <mattbob4@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-03-05 08:03:00 +01:00
Matthew Cather
22eaf18647 hostapd: clean-up references to local variables
Remove extra ucv_get calls when passing a referenced value to an object
without using it further.

Signed-off-by: Matthew Cather <mattbob4@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-03-05 08:03:00 +01:00