]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
16 months agoOpenSSL: Fix a memory leak in CMAC
Jouni Malinen [Wed, 27 Mar 2024 18:35:25 +0000 (20:35 +0200)] 
OpenSSL: Fix a memory leak in CMAC

The OpenSSL 3.0 (or newer) version of omac1_aes_vector() did not free
the EVP_MAC. This resulted in a memory leak that shows up in a bit
strange way in valgrind reports and because of that, was not caught
during automated testing.

Fixes: 0c61f6234fd2 ("OpenSSL: Implement CMAC using the EVP_MAC API")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoAP MLD: Remove restriction of having to disable the first link BSS last
Aditya Kumar Singh [Wed, 6 Mar 2024 06:41:19 +0000 (12:11 +0530)] 
AP MLD: Remove restriction of having to disable the first link BSS last

The first link BSS was always disabled last. However, now the first BSS
can be dynamically adjusted. Hence, remove such restriction.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoAP MLD: Support removal of link station from AP
Aditya Kumar Singh [Wed, 6 Mar 2024 06:41:03 +0000 (12:11 +0530)] 
AP MLD: Support removal of link station from AP

Whenever ap_free_sta() was called, it deleted the whole station entry
from the kernel as well. However, with MLD stations, there is a
requirement to delete only the link station.

Add support to remove the link station alone from an MLD station. If the
link going to be removed is the association link, the whole station
entry will be removed.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agonl80211: Add callback function for removing link STAs
Aditya Kumar Singh [Wed, 6 Mar 2024 06:41:03 +0000 (12:11 +0530)] 
nl80211: Add callback function for removing link STAs

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoExport hostapd_sta_is_link_sta()
Aditya Kumar Singh [Wed, 6 Mar 2024 06:41:03 +0000 (12:11 +0530)] 
Export hostapd_sta_is_link_sta()

This functionality can be shared with other files as well.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoAP MLD: De-initialize/disable link BSS properly
Aditya Kumar Singh [Wed, 6 Mar 2024 06:40:16 +0000 (12:10 +0530)] 
AP MLD: De-initialize/disable link BSS properly

When the first link BSS of an interface was de-initialized/disabled, the
whole MLD was brought down. All other links were stopped beaconing and
links were removed. And if the non-first link BSS was
de-initialized/disabled, nothing happened. Even beaconing was not
stopped which is wrong.

Fix this by properly bringing down the intended link alone from the
interface.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agonl80211: Print the MLD capabilities in debug
Aditya Kumar Singh [Wed, 6 Mar 2024 06:39:58 +0000 (12:09 +0530)] 
nl80211: Print the MLD capabilities in debug

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoAP MLD: Fix advertisement of MLD capabilities
Aditya Kumar Singh [Wed, 6 Mar 2024 06:39:58 +0000 (12:09 +0530)] 
AP MLD: Fix advertisement of MLD capabilities

Previously, hostapd directly advertised the MLD capabilities received
from the driver. Since this information is exchanged during
initialization time only, the driver will advertise the maximum
supported values. hostapd should parse it and then based on the current
situation fill the values accordingly.

For example, the maximum number of simultaneous links is supposed to be
a value between 0 and 14, which is the number of affiliated APs minus 1.
The driver advertises this value as 5 and hostapd, irrespective of the
current active links, puts 5 in the frames.

Fix this by parsing the value from the driver capabilities and then
using the values as per the current situation of the links. The
advertised values will be used as the upper limit.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoAP MLD: Refresh beacons for other links when one gets disabled/enabled
Aditya Kumar Singh [Wed, 6 Mar 2024 06:39:43 +0000 (12:09 +0530)] 
AP MLD: Refresh beacons for other links when one gets disabled/enabled

If one or more BSS from the interface is partnering with BSSs from
another interface and if this interface gets disabled, the Beacon frames
need to be refreshed for other interfaces. Similar thing should happen
when it gets enabled.

Add logic to refresh other interface Beacon frames when one of the
interfaces is disabled or enabled.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoAP MLD: Support link removal before removing interface
Aditya Kumar Singh [Wed, 6 Mar 2024 06:39:27 +0000 (12:09 +0530)] 
AP MLD: Support link removal before removing interface

Previously, whenever if_remove() was called, the whole interface was
deleted. In an AP MLD, all partner BSS use the same driver private
context and hence removing the interface when only one of the links goes
down should be avoided.

Add a helper function to remove a link first whenever if_remove() is
called. Later while handling it, if the number of active links goes to
0, if_remove() would be called to clean up the interface.

This helper function will be used later when co-hosted AP MLD support is
added and as well later during ML reconfiguration support.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agonl80211: Remove AP MLD links while removing the interface
Aditya Kumar Singh [Wed, 6 Mar 2024 06:39:14 +0000 (12:09 +0530)] 
nl80211: Remove AP MLD links while removing the interface

When the interface was removed, the added links were not removed. While
removing the interface, kernel has removed the stale links but hostapd
has not. This is wrong since hostapd should remove and do the clean ups
properly while removing the interface.

Hence, remove the links when interface is removed.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agonl80211: Use per-BSS command for remove link
Aditya Kumar Singh [Wed, 6 Mar 2024 06:38:58 +0000 (12:08 +0530)] 
nl80211: Use per-BSS command for remove link

Construct the nl80211 remove link command using the per-BSS approach
instead of per-driver (drv->first_bss).

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agonl80211: Re-factor nl80211_remove_links() function
Aditya Kumar Singh [Wed, 6 Mar 2024 06:38:58 +0000 (12:08 +0530)] 
nl80211: Re-factor nl80211_remove_links() function

nl80211_remove_links() iterated over all active links in the given BSS
and removed all of them. However, at times it is required to remove only
one link and not all links.

Add a helper function nl80211_remove_link() which will remove just the
given link_id from the passed BSS. nl80211_remove_links() will use this
and will call this for each of the active links to be removed.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agonl80211: Remove redundant put_freq call in set_ap() for AP MLD
Aditya Kumar Singh [Wed, 6 Mar 2024 06:38:40 +0000 (12:08 +0530)] 
nl80211: Remove redundant put_freq call in set_ap() for AP MLD

wpa_driver_nl80211_set_ap() called nl80211_put_freq_params() twice if AP
is an AP MLD. It called once while putting the MLO link ID and the other
time in the normal flow if frequency info is present. Doing this twice
is not required.

Call put_freq once during the normal flow only and separately of that,
add the link ID for AP MLD.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agonl80211: Fix set_ap() to add frequency without CONFIG_IEEE80211AX
Jouni Malinen [Wed, 27 Mar 2024 09:31:25 +0000 (11:31 +0200)] 
nl80211: Fix set_ap() to add frequency without CONFIG_IEEE80211AX

This call was added within a conditional CONFIG_IEEE80211AX block even
though this can apply without that build option. Move this outside that
conditional block.

Fixes: b3921db426ea ("nl80211: Add frequency info in start AP command")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agonl80211: Cache hostapd_data context in per link BSS struct for AP MLD
Aditya Kumar Singh [Wed, 6 Mar 2024 06:38:22 +0000 (12:08 +0530)] 
nl80211: Cache hostapd_data context in per link BSS struct for AP MLD

Cache the corresponding hostapd_data struct context into the link entry
within the driver wrapper. This will be useful for driver events
callback processing.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoAP MLD: Clean up MLD when not required any further
Aditya Kumar Singh [Wed, 6 Mar 2024 06:38:08 +0000 (12:08 +0530)] 
AP MLD: Clean up MLD when not required any further

Currently, whenever a new BSS is created, if it is an EHT BSS it is tied
to a corresponding MLD structure. If the structure does not exist
already, a new one is created and tied to it. Accordingly, the link ID
is assigned as well. However, when the BSS is deleted, the MLD structure
is not freed and when it is again created the next time, the link ID is
incremented further and the BSS gets a wrong link ID.

For example, 2.4 GHz single link AP MLD case: First ADD, link ID 0 would
be assigned and MLD interface wlan0 would be created. When REMOVE is
issued, the BSS would be deleted but MLD wlan0 will not. When ADD is
issued again, the BSS will tie back to MLD wlan0 but this time the link
ID will be incremented again and 1 would be assigned. Hence, at
subsequent REMOVE/ADD, the link ID keeps on incrementing.

Since the link ID remains same for the full lifetime of the BSS and MLD,
the next link ID counter cannot be just reset back to 0 when a BSS is
deleted. Otherwise, in interleaved link enable/disable case, the link ID
would be changed.

To overcome this situation, whenever a BSS is deleted, if the MLD is not
referenced by any other existing BSS, delete the MLD structure itself.

To know how many BSSs are referring a given MLD, introduce a new member
refcount in MLD. If the value is 0 it is safe to delete the MLD.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoAP MLD: Assign link ID during BSS creation
Aditya Kumar Singh [Wed, 6 Mar 2024 06:37:52 +0000 (12:07 +0530)] 
AP MLD: Assign link ID during BSS creation

Link ID was assigned when BSS is going through setup and the driver
interface init. Later if interface is disabled and enabled again, setup
BSS is called which will give a new link ID to it. However, Link ID
should be same for a BSS affliated to an AP MLD for the full lifetime of
the BSS.

Hence, assign the link ID during BSS creation itself. And it will remain
until BSS entry is completely freed. Hence, link ID will not change as
part of disable/enable.

Also, since link ID would be decided now, it will help in creating link
level control sockets in a subsequent patch.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoAP MLD: Use MLD struct for MLD level information
Aditya Kumar Singh [Wed, 6 Mar 2024 06:37:32 +0000 (12:07 +0530)] 
AP MLD: Use MLD struct for MLD level information

MLD level structure is present to store the MLD level information.

Add changes to use the MLD structure instead of link specific struct
hostapd_data to get/set the MLD level information.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agoAP MLD: Add a separate MLD level structure
Aditya Kumar Singh [Wed, 6 Mar 2024 06:37:13 +0000 (12:07 +0530)] 
AP MLD: Add a separate MLD level structure

MLD level information like MLD MAC address, next link ID, etc. was
stored in each BSS. However, only the first link BSS assigns values to
these members and the other link BSSs store references to the first BSS.
However, if the first BSS is disabled, the first BSS reference in all
BSS should be updated which is an overhead. Also, this does not seem to
scale.

Instead, a separate MLD level structure can be maintained which can
store all this ML related information. All affiliated link BSSs can keep
reference to this MLD structure.

This commit adds that MLD level structure. However, assigning values to
it and using that instead of BSS level members will be done in
subsequent commits.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agotests: AP MLD: Remove mld_id config
Aditya Kumar Singh [Wed, 6 Mar 2024 06:36:56 +0000 (12:06 +0530)] 
tests: AP MLD: Remove mld_id config

mld_id config is not used anymore. Remove its use from test cases.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agohostapd: MLO: Avoid use of mld_id as user configuration
Sriram R [Wed, 6 Mar 2024 06:36:33 +0000 (12:06 +0530)] 
hostapd: MLO: Avoid use of mld_id as user configuration

mld_id was provided as a user configuration to identify partner BSS
belonging to the same AP MLD. The same id is used at the protocol level
also to indicate the AP MLD ID of the MLD.

But, in general mld_id is a relative reference of the MLD where 0 is
used as the mld_id to represent the self MLD and in case of MLO MBSSID
mld_id of a non transmitted BSS affiliated to an AP MLD is based on the
relative BSS index of the non transmitted BSS from the transmitted BSS.
Hence mld_id need not be fetched from users, rather it can be identified
wherever required.

To verify if the partners belong to the same AP MLD the interface name
can be checked, since all link BSS partners of the same AP MLD belong to
the same interface.

Hence, remove use of mld_id user config and instead introduce two
functions hostapd_is_ml_partner() and hostapd_get_mld_id(). The former
is used to verify whether partners belong to the same AP MLD and the
latter is used to get the MLD ID of the BSS.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agotests: Clear sae_groups in eht_mld_legacy_stas
Jouni Malinen [Tue, 26 Mar 2024 17:13:47 +0000 (19:13 +0200)] 
tests: Clear sae_groups in eht_mld_legacy_stas

This is needed to avoid failures due to previous test cases having left
sae_groups set to something else than the default.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agonl80211: Fix potential NULL pointer dereference in set_ap()
Karthikeyan Kathirvel [Tue, 5 Mar 2024 07:09:44 +0000 (12:39 +0530)] 
nl80211: Fix potential NULL pointer dereference in set_ap()

In the code review, it was found that param->freq is accessed without
NULL check in wpa_driver_nl80211_set_ap(), while in other sections of
the code, freq is accessed only after NULL validation. This situation
could result in a segmentation fault at least in theory.

Add a NULL check for freq before accessing it to be consistent with the
other uses.

Fixes: 0c6c948047de ("nl80211: Support setting up an AP on a specified link")
Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
16 months agoRemove unused wpa_drv_set_ap()
Jouni Malinen [Tue, 26 Mar 2024 15:51:28 +0000 (17:51 +0200)] 
Remove unused wpa_drv_set_ap()

This wrapper function was not used at all, so remove it to make it
clearer that the set_ap() driver op is called only from hostapd code.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agonl80211: Fix AP MLD frequency update on channel switch
Chenming Huang [Wed, 13 Mar 2024 12:38:26 +0000 (18:08 +0530)] 
nl80211: Fix AP MLD frequency update on channel switch

mlme_event() calls nl80211_get_link_id_by_freq() to determine the link
to handle reported events. However, in channel switch event it is always
setting freq to the default link that leads to the issue that all other
events that go to mlme_event() will be handled in the default link.

Fix this by setting freq to the correct link specified by the link ID
when processing the event for a completed channel switch.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
16 months agotests: Convert sigma_dut control to a context manager class
Jouni Malinen [Sat, 23 Mar 2024 22:24:07 +0000 (00:24 +0200)] 
tests: Convert sigma_dut control to a context manager class

This cleans up the implementation and makes stopping of sigma_dut (and
cleanup after some parameters it might leave behind) more robust.

Signed-off-by: Jouni Malinen <j@w1.fi>
16 months agotests: Make rrm_reassociation more robust
Jouni Malinen [Sat, 23 Mar 2024 20:22:07 +0000 (22:22 +0200)] 
tests: Make rrm_reassociation more robust

It was possible for this test case to fail if a previously executed test
case left another BSS entry for the BSSID used by the second AP here.
That could have skipped the needed scan with scan_for_bss(bssid2). Force
this command to run a new scan to discover the second AP correctly.

Signed-off-by: Jouni Malinen <j@w1.fi>
16 months agonl80211: Fix sending NL80211_CMD_DEL_BEACON command to wrong interface
Nikita Chernikov [Mon, 11 Mar 2024 16:58:21 +0000 (18:58 +0200)] 
nl80211: Fix sending NL80211_CMD_DEL_BEACON command to wrong interface

The NL80211_CMD_DEL_BEACON command was always sent to the main interface
of the radio instead of the desired BSS interface, e.g., when sending a
STOP_AP control interface command from upper layer.

Signed-off-by: Nikita Chernikov <nchernikov@maxlinear.com>
16 months agowpa_cli: Don't select interface when using global socket
Janusz Dziedzic [Sat, 9 Mar 2024 19:42:28 +0000 (20:42 +0100)] 
wpa_cli: Don't select interface when using global socket

In case we run command like:
wpa_cli -g <global_ctrl_path> command

don't print
"Selected interface " message.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
16 months agotests: remotehost: Extend proc API
Janusz Dziedzic [Sat, 9 Mar 2024 19:42:22 +0000 (20:42 +0100)] 
tests: remotehost: Extend proc API

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
16 months agoAdd a vendor attribute per MLO link ratemask bitmap configuration
Shailendra Singh [Fri, 23 Feb 2024 11:49:32 +0000 (17:19 +0530)] 
Add a vendor attribute per MLO link ratemask bitmap configuration

Define attribute QCA_WLAN_VENDOR_ATTR_RATEMASK_PARAMS_LINK_ID in
enum qca_wlan_vendor_attr_ratemask_params to configure ratemask
per MLO link. If the attribute is not provided, ratemask will be
applied for setup link.

Signed-off-by: Shailendra Singh <quic_shasing@quicinc.com>
16 months agoDocument vendor command ratemask bitmap for EHT case
Shailendra Singh [Fri, 23 Feb 2024 12:47:48 +0000 (18:17 +0530)] 
Document vendor command ratemask bitmap for EHT case

In addition, update the comment on the number of bits used with HE to
match the defined bits.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoAdd QCA vendor sub-command and attribute for spectral scan completion
Nagasai Bharat Gatkeshwar Sainoji [Wed, 6 Mar 2024 12:08:56 +0000 (17:38 +0530)] 
Add QCA vendor sub-command and attribute for spectral scan completion

Add a new QCA vendor sub-command
QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_COMPLETE which will be used as a
netlink event to indicate the completion of a spectral scan request.
This event can also be sent incase of the spectral scan request timeout.

To be able to configure the timeout the value, add a new vendor
attribute QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_COMPLETION_TIMEOUT in
enum qca_wlan_vendor_attr_spectral_scan.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoAdd QCA vendor attribute indicating the spectral transport mode
Nagasai Bharat Gatkeshwar Sainoji [Thu, 29 Feb 2024 15:47:58 +0000 (21:17 +0530)] 
Add QCA vendor attribute indicating the spectral transport mode

Add a vendor attribute QCA_WLAN_VENDOR_ATTR_SPECTRAL_DATA_TRANSPORT_MODE
to indicate the current spectral data transport mechanism to be used to
get spectral scan samples from the driver to userspace.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agotests: Clear scan cache for SAE-EXT-KEY tests
Jouni Malinen [Wed, 20 Mar 2024 16:13:08 +0000 (18:13 +0200)] 
tests: Clear scan cache for SAE-EXT-KEY tests

These test cases check the BSS entry information and if the kernel scan
cache maintains an old BSS entry for a previous test case for the same
BSSID this can result in a false failure.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoOptimize internal BSS table updates based on a specific BSSID
Jouni Malinen [Wed, 20 Mar 2024 09:20:43 +0000 (11:20 +0200)] 
Optimize internal BSS table updates based on a specific BSSID

When wpa_supplicant needed to update the internal BSS table with the
latest scan results from the driver, it fetched all BSSs and processed
them all. This is unnecessary for cases where an update is needed only
for a specific BSS. Optimize this by filtering out the unnecessary
entries from the results.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoUpdate BSS entry on roaming only for actual BSS frequency change
Jouni Malinen [Wed, 20 Mar 2024 09:08:16 +0000 (11:08 +0200)] 
Update BSS entry on roaming only for actual BSS frequency change

Commit 117e812d06e6 ("Update BSS table entry if roaming event indicates
frequency change") added wpa_supplicant BSS table update based on the
latest driver scan results whenever processing an association event that
results in the current operating channel changing. While that is needed
to cover the case where an AP changes its own operating channel (and
that is noticed as a roam or new connection instead of a channel switch
event), this should not really be needed for cases where the
wpa_supplicant entry for the new BSS is already up to date.

Skip the full BSS table update on association event if the event is for
a roaming case to a different BSS and the BSS entry for the target is
already available and for the current operating channel. This avoids
undesired latency when processing the association event.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoMulti-AP: WPS support for different Multi-AP profiles
Manoj Sekar [Mon, 26 Feb 2024 12:59:13 +0000 (18:29 +0530)] 
Multi-AP: WPS support for different Multi-AP profiles

Update EAP-WSC parameters to include Multi-AP profile info to pass the
profile information through the provisioning steps. This is needed for
provisioning the STA configuration when different profiles are used.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
16 months agoMulti-AP: Add support for VLAN related information
Manoj Sekar [Mon, 26 Feb 2024 12:56:38 +0000 (18:26 +0530)] 
Multi-AP: Add support for VLAN related information

Add support to fill "multi_ap_vlanid" info to the hostapd config file.
Add the Multi-AP Default 802.1Q Setting subelement into Multi-AP element
generating and parsing.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
16 months agoMulti-AP: Add hostapd config option to disallow certain profiles
Manoj Sekar [Mon, 26 Feb 2024 12:51:33 +0000 (18:21 +0530)] 
Multi-AP: Add hostapd config option to disallow certain profiles

Add a new config option "multi_ap_client_disallow" to control allowing
backhaul STA with certain profiles alone to associate. This is done to
adhere to Wi-Fi EasyMesh specification which defined rules to
allow/disallow association of backhaul STA of certain profiles.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
16 months agoMulti-AP: Reject non-Multi-AP STA association on backhaul-only BSS
Manoj Sekar [Mon, 26 Feb 2024 12:48:21 +0000 (18:18 +0530)] 
Multi-AP: Reject non-Multi-AP STA association on backhaul-only BSS

Do not allow non-Multi-AP STAs to associate with a BSS that is
configured as a backhaul-only.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
16 months agoMulti-AP: Allow supported profile to be configured
Manoj Sekar [Mon, 26 Feb 2024 12:48:21 +0000 (18:18 +0530)] 
Multi-AP: Allow supported profile to be configured

Allow both hostapd and wpa_supplicant to be configured with the
supported Multi-AP profile. The configured value will be advertised in
the Multi-AP element.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
16 months agoMulti-AP: Parse Profile subelement
Manoj Sekar [Mon, 26 Feb 2024 12:48:21 +0000 (18:18 +0530)] 
Multi-AP: Parse Profile subelement

Parse the indicate profile support for the Multi-AP Profile subelement.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
16 months agoMulti-AP: Generation of Multi-AP Profile subelement
Manoj Sekar [Mon, 26 Feb 2024 12:48:21 +0000 (18:18 +0530)] 
Multi-AP: Generation of Multi-AP Profile subelement

Add support for including the Multi-AP Profile subelement into the
Multi-AP element.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
16 months agoMulti-AP: Parse the Multi-AP element using a shared helper function
Manoj Sekar [Mon, 26 Feb 2024 12:48:21 +0000 (18:18 +0530)] 
Multi-AP: Parse the Multi-AP element using a shared helper function

This makes it more convenient to handle extensions to the element and
allows code to be shared between hostapd and wpa_supplicant.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
16 months agoMulti-AP: Use proper length for remaining buffer for the element
Jouni Malinen [Tue, 19 Mar 2024 14:44:00 +0000 (16:44 +0200)] 
Multi-AP: Use proper length for remaining buffer for the element

Replace the hardcoded buffer length with the actually number of
remaining bytes on the buffer. This is needed to be able to do real
buffer size validation within add_multi_ap_ie().

Furthermore, make hostapd_eid_multi_ap() static since it is not used
outside this file.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoMulti-AP: Move IE parameters into a struct for extensibility
Manoj Sekar [Mon, 26 Feb 2024 12:48:21 +0000 (18:18 +0530)] 
Multi-AP: Move IE parameters into a struct for extensibility

This makes it easier to extend the information that is encoded in the
Multi-AP element.

Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
16 months agotests: cfg80211_tx_frame: filter frames based on SA
Jouni Malinen [Sun, 17 Mar 2024 17:55:11 +0000 (19:55 +0200)] 
tests: cfg80211_tx_frame: filter frames based on SA

This makes the test care less likely to fail due to another STA
happening to be listening for Public Action frames and replying to the
P2P GO Negotiation Request.

Signed-off-by: Jouni Malinen <j@w1.fi>
16 months agotests: Allow WlantestCapture to be used with context managers
Jouni Malinen [Sun, 17 Mar 2024 14:27:54 +0000 (16:27 +0200)] 
tests: Allow WlantestCapture to be used with context managers

In addition, convert many of the uses to do so.

Signed-off-by: Jouni Malinen <j@w1.fi>
16 months agotests: Clean up test case importing
Jouni Malinen [Sun, 17 Mar 2024 13:39:54 +0000 (15:39 +0200)] 
tests: Clean up test case importing

Move this to a helper function and return a set of test names instead of
a list.

Signed-off-by: Jouni Malinen <j@w1.fi>
16 months agotests: Add missed test case __doc__ strings
Jouni Malinen [Sun, 17 Mar 2024 13:21:11 +0000 (15:21 +0200)] 
tests: Add missed test case __doc__ strings

Signed-off-by: Jouni Malinen <j@w1.fi>
16 months agotests: Verify test case function documentation
Jouni Malinen [Sun, 17 Mar 2024 13:20:26 +0000 (15:20 +0200)] 
tests: Verify test case function documentation

Check that each test case function includes a title in __doc__ and also
verify that the same test case is not added multiple times from
different files.

Signed-off-by: Jouni Malinen <j@w1.fi>
16 months agotests: Use CS more carefully in p2p_device_autogo_chan_switch
Jouni Malinen [Sat, 9 Mar 2024 16:08:52 +0000 (18:08 +0200)] 
tests: Use CS more carefully in p2p_device_autogo_chan_switch

Do not disable HT support on the GO and wait for the channel switch
event on the P2P Client before proceeding with connectivity test.

Signed-off-by: Jouni Malinen <j@w1.fi>
16 months agotests: Use triple double quotes around docstrings more consistently
Jouni Malinen [Sat, 9 Mar 2024 15:11:03 +0000 (17:11 +0200)] 
tests: Use triple double quotes around docstrings more consistently

Signed-off-by: Jouni Malinen <j@w1.fi>
16 months agoDBus: Add ANQP fields to BSS properties
Damien Dejean [Mon, 26 Feb 2024 16:32:41 +0000 (16:32 +0000)] 
DBus: Add ANQP fields to BSS properties

Add ANQP fields to the BSS properties to allow DBus clients to be
notified and obtain the values when it changes.

Signed-off-by: Damien Dejean <damiendejean@chromium.org>
16 months agoDBus: Signal ANQP query done
Damien Dejean [Tue, 20 Feb 2024 12:12:11 +0000 (12:12 +0000)] 
DBus: Signal ANQP query done

Add a D-Bus signal "ANQPQueryDone" to notify of the result of an ANQP
request.

Signed-off-by: Damien Dejean <damiendejean@chromium.org>
16 months agoDBus: Add a method to get ANQP fields
Damien Dejean [Tue, 20 Feb 2024 12:11:40 +0000 (12:11 +0000)] 
DBus: Add a method to get ANQP fields

Add a D-Bus method to perform ANQP get requests. The new method is
equivalent to the "anqp_get" command available in wpa_cli.

Signed-off-by: Damien Dejean <damiendejean@chromium.org>
16 months agoDBus: Add dict helper for uint16 arrays
Damien Dejean [Tue, 20 Feb 2024 12:11:40 +0000 (12:11 +0000)] 
DBus: Add dict helper for uint16 arrays

Extend dict helper to support uint16 arrays.

Signed-off-by: Damien Dejean <damiendejean@chromium.org>
16 months agoOpenSSL: Fix a memory leak on hpke_labeled_expand() error path
Chien Wong [Tue, 5 Mar 2024 14:20:41 +0000 (22:20 +0800)] 
OpenSSL: Fix a memory leak on hpke_labeled_expand() error path

Fixes: 786ea402bc5f ("HPKE base mode with single-shot API")
Signed-off-by: Chien Wong <m@xv97.com>
16 months agoOpenSSL: Fix a memory leak on openssl_evp_pkey_ec_prime_len() error path
Chien Wong [Tue, 5 Mar 2024 14:20:40 +0000 (22:20 +0800)] 
OpenSSL: Fix a memory leak on openssl_evp_pkey_ec_prime_len() error path

Fixes: b700a56e1478 ("OpenSSL 3.0: Determine the prime length for an EC key group using EVP_PKEY")
Signed-off-by: Chien Wong <m@xv97.com>
16 months agoDPP: Emit a DPP PB_STATUS event when push button starts
Evan Benn [Mon, 4 Mar 2024 02:24:31 +0000 (13:24 +1100)] 
DPP: Emit a DPP PB_STATUS event when push button starts

To implement an action script that listens for DPP push button events
and for example blinks a LED it is useful to know when push button has
started. Emit an event when push button starts.

Signed-off-by: Evan Benn <evan.benn@morsemicro.com>
16 months agotests: Wait for a specific DPP-PB-STATUS event
Jouni Malinen [Fri, 8 Mar 2024 08:36:38 +0000 (10:36 +0200)] 
tests: Wait for a specific DPP-PB-STATUS event

This wait for a specific event is needed to allow a new DPP-PB-STATUS
event to be added at the start of the PB operation.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agotests: Add basic MLO CSA test case
Aditya Kumar Singh [Fri, 8 Mar 2024 04:35:08 +0000 (10:05 +0530)] 
tests: Add basic MLO CSA test case

Verify that CSA can be performed on the first link of an AP MLD and
further check that traffic still continues even after channel switch.

Finally, check again that a subsequent CSA can be performed without
affecting the data traffic.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
16 months agotests: Set valid configuration for EHT puncturing tests
Johannes Berg [Mon, 29 Jan 2024 18:26:39 +0000 (19:26 +0100)] 
tests: Set valid configuration for EHT puncturing tests

When puncturing is used on EHT, the HT/VHT/HE channel configuration must
not encompass the punctured subchannel, so must use a lower bandwidth.
Change the puncturing tests accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
16 months agoRevert "tests: Remove eht_5ghz_80mhz_puncturing_override_1 for now"
Jouni Malinen [Fri, 8 Mar 2024 08:03:41 +0000 (10:03 +0200)] 
Revert "tests: Remove eht_5ghz_80mhz_puncturing_override_1 for now"

This reverts commit eecaceed8f03cee676d47dd9fb70efd25d50e3e9. This test
case can now be restored since hostapd is modified to allow test cases
changes to be done to cover the special impact from EHT puncturing to
available HT/VHT/HE channel bandwidth in this particular case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoEHT: More accurate no-second-channel-offset checks when puncturing
Jouni Malinen [Fri, 8 Mar 2024 08:02:49 +0000 (10:02 +0200)] 
EHT: More accurate no-second-channel-offset checks when puncturing

This is needed to allow some cases where puncturing prevents HT/VHT/HE
from using the full channel bandwidth.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoEHT: Support punct_bitmap overriding in HE element generation
Jouni Malinen [Fri, 8 Mar 2024 08:12:16 +0000 (10:12 +0200)] 
EHT: Support punct_bitmap overriding in HE element generation

This was already added for VHT, but a similar change is needed for HE as
well.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoMove punct_update_legacy_bw() into src/common
Jouni Malinen [Fri, 8 Mar 2024 08:10:41 +0000 (10:10 +0200)] 
Move punct_update_legacy_bw() into src/common

This function is needed for more common operations so move it to a more
suitable location.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoProvide punct_bitmap to hostapd_set_freq_params()
Jouni Malinen [Fri, 8 Mar 2024 08:01:30 +0000 (10:01 +0200)] 
Provide punct_bitmap to hostapd_set_freq_params()

This is needed to be able to check validity of the channel parameters
for cases where EHT puncturing impacts what can be enabled for
HT/VHT/HE.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoEHT: Move puncturing bitmap determination into a helper function
Jouni Malinen [Fri, 8 Mar 2024 08:00:35 +0000 (10:00 +0200)] 
EHT: Move puncturing bitmap determination into a helper function

Avoid duplicated implementation for this by using a shared helper
function.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agotests: Remove eht_5ghz_80mhz_puncturing_override_1 for now
Jouni Malinen [Wed, 6 Mar 2024 20:38:09 +0000 (22:38 +0200)] 
tests: Remove eht_5ghz_80mhz_puncturing_override_1 for now

mac80211 has been modified to reject the configuration that is used in
this test case. For now, remove this until the puncturing of the second
20 MHz segment can be handled in a manner that allows mac80211 STA to
use EHT.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoEHT: Use eht_oper_puncturing_override when constructing VHT elements
Jouni Malinen [Wed, 6 Mar 2024 20:34:57 +0000 (22:34 +0200)] 
EHT: Use eht_oper_puncturing_override when constructing VHT elements

The testing functionality for overriding EHT puncturing bitmap was
applied only for the EHT elements. The mac80211 has been updated to
enforce compartibility between EHT and HT/VHT information and that made
the related test cases fail. Apply the override value for VHT element
generation to avoid some of those issues.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agotests: Do not drop HT capability on CS to avoid test failures
Jouni Malinen [Wed, 6 Mar 2024 17:32:16 +0000 (19:32 +0200)] 
tests: Do not drop HT capability on CS to avoid test failures

Leave the HT capability of the AP as-is when running channel switch test
cases that started failing with a recent kernel change that disconnects
on such "unexpected" change in AP capabilities.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agotests: Fix fuzzing tester for WNM
Jouni Malinen [Wed, 6 Mar 2024 15:36:10 +0000 (17:36 +0200)] 
tests: Fix fuzzing tester for WNM

Processing of WNM frames can results in a lookup of the current BSS
table. As such, the testing tool needs to initialize the BSS table to
avoid NULL pointer dereferences. This is not an issue that would show up
with real production uses with wpa_supplicant since wpa_bss_init() is
called there.

Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=67244
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
17 months agoFix fuzzing test build
Jouni Malinen [Tue, 5 Mar 2024 15:09:25 +0000 (17:09 +0200)] 
Fix fuzzing test build

The commit that renamed the WNM BTM deallocation function forgot to
update the fuzz tester tool.

Fixes: e508c070c40e ("WNM: Keep BTM information until connection completes")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
17 months agotests: Update Supported Operating Classes element validation
Jouni Malinen [Tue, 5 Mar 2024 15:02:45 +0000 (17:02 +0200)] 
tests: Update Supported Operating Classes element validation

The wpa_supplicant implementation for building the Supported Operating
Classes element was modified to add support for 80 MHz and wider
bandwidth on the 6 GHz band, 2-octet operating classes, and freq_list on
the 6 GHz band. Update the test cases that verify exact encoding of this
information to match the implementation changes.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
17 months agoHandle 6 GHz channels in Supported Operating Classes with freq_list
Jouni Malinen [Tue, 5 Mar 2024 15:01:30 +0000 (17:01 +0200)] 
Handle 6 GHz channels in Supported Operating Classes with freq_list

Only the 2.4 and 5 GHz channels were handled previously when removing
operating classes from the Supported Operating Classes element based on
the freq_list parameter. Extend this to include the 6 GHz band as well.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
17 months ago2-octet operating classes in Support Operating Classes element
Jouni Malinen [Tue, 5 Mar 2024 14:07:22 +0000 (16:07 +0200)] 
2-octet operating classes in Support Operating Classes element

A previous workaround was used to move the special operating class 130
to the end of the Supported Operating Classes element to avoid getting
any following entry being ignored or misunderstood. That is not really
the correct way of encoding the special cases, i.e., 80+80 MHz channels
that use two nonadjacent frequency segments.

Add support for encoding the 80+80 MHz channel with the 2-octet
operating class design using the Operating Class Duple sequence field of
the Supported Operating Classes element instead of listing the operating
classes that have the 80+ behavior limit set indication in Table E-4
(i.e., opclass 130 and 135) as 1-octet operating classes in the
Operating Classes field.

Fixes: a92660a00e10 ("Work around Supported Operating Classes element issues for 6 GHz")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
17 months agotests: Verify supported operating classes indication for 6 GHz
Jouni Malinen [Mon, 4 Mar 2024 16:48:06 +0000 (18:48 +0200)] 
tests: Verify supported operating classes indication for 6 GHz

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
17 months agoExtend support for the 6 GHz operating class 137 (320 MHz)
Ainy Kumari [Thu, 22 Feb 2024 04:02:04 +0000 (09:32 +0530)] 
Extend support for the 6 GHz operating class 137 (320 MHz)

Commit 085a3fc76e6b ("EHT: Add 320 channel width support") added this in
various places, but it did not cover everything. Extend this support to
be more complete. In particular, this allows wpa_supplicant to report
the operating class 137 in the Supported Operating Classes element and
to use it when processing beacon requests.

Signed-off-by: Ainy Kumari <quic_ainykuma@quicinc.com>
17 months agonl80211: Process 6 GHz regulatory rules to accurate channel flags
Ainy Kumari [Thu, 22 Feb 2024 04:02:04 +0000 (09:32 +0530)] 
nl80211: Process 6 GHz regulatory rules to accurate channel flags

This is needed to be able to indicate all supported operating classes.

Signed-off-by: Ainy Kumari <quic_ainykuma@quicinc.com>
17 months agoUse a helper function to free neighbor DB entries
Jouni Malinen [Sun, 3 Mar 2024 18:41:30 +0000 (20:41 +0200)] 
Use a helper function to free neighbor DB entries

There is no need to duplicate this code in multiple locations.

Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agoClear all neighbor entry items explicitly
Jouni Malinen [Sun, 3 Mar 2024 18:39:29 +0000 (20:39 +0200)] 
Clear all neighbor entry items explicitly

Do not leave some of the variables to their previously used values when
a neighbor entry is cleared.

Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agoUpdate own report in nr_db if SSID is changed
Nikita Chernikov [Thu, 1 Feb 2024 16:05:02 +0000 (18:05 +0200)] 
Update own report in nr_db if SSID is changed

short_ssid in the own neighbor report might get out of sync, causing
advertising RNR element based on the old SSID, when SSID is changed
either with control interface command SET or with SIGHUP. Therefore,
sync the own report entry by removing the old entry and setting own
report again if the short SSID value has changed.

Signed-off-by: Nikita Chernikov <nchernikov@maxlinear.com>
17 months agoAP MLD: Set link address only when non-AP MLD is not added to driver
Michael-CY Lee [Thu, 15 Feb 2024 07:36:41 +0000 (15:36 +0800)] 
AP MLD: Set link address only when non-AP MLD is not added to driver

Once the non-AP MLD is added to the driver, the driver handles the
address translation so that hostapd receives Management frames with
SA/DA being translated into MLD MAC addresses.

If the Authentication frmae is retransmitted with transaction being 1,
SA of the retransmitted Authentication frame is translated into the MLD
MAC address by the driver, and then in the function handle_auth(),
sta->mld_info.links[].peer_addr would be replaced by the MLD MAC address
even though it is supposed to be the link address.

Therefore, update the MLD information only when the STA has not yet been
added into the driver to avoid replacing the previously determined link
address with the MLD MAC address.

Fixes: bcbe80a66 ("AP: MLO: Handle Multi-Link element during authentication")
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
17 months agoFix INTERFACES command buffer size to allow more data
Mujibur Rahiman K [Wed, 14 Feb 2024 10:03:25 +0000 (15:33 +0530)] 
Fix INTERFACES command buffer size to allow more data

reply_size instead sizeof(buffer) should be provided to
hostapd_global_ctrl_iface_interfaces() when processing INTERFACES
commands. The previous use of sizeof(buffer) used a significantly
shorter limit (256 vs. 4096 bytes) for the output and this could have
resulted in unnecessary truncation of the output.

Fixes: 618f5d01b0cf ("hostapd: Add INTERFACES ctrl_iface command")
Signed-Off-By : Mujibur Rahiman K mujiburrahimank@maxlinear.com

17 months agohostapd: Dump VHT/HE/EHT full capabilities in STA command output
Janusz Dziedzic [Tue, 27 Feb 2024 17:17:47 +0000 (18:17 +0100)] 
hostapd: Dump VHT/HE/EHT full capabilities in STA command output

Show full VHT/HE/EHT capabilities for connected stations.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
17 months agoUse os_snprintf_error() more consistently in STA output generation
Jouni Malinen [Sun, 3 Mar 2024 18:01:27 +0000 (20:01 +0200)] 
Use os_snprintf_error() more consistently in STA output generation

In theory, os_snprintf() could return a negative value and as such,
os_snprintf_error() should be used in all cases where the buffer might
not be large enough.

Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agoDo not change out-of-range configuration parameters
Jouni Malinen [Sun, 3 Mar 2024 17:55:45 +0000 (19:55 +0200)] 
Do not change out-of-range configuration parameters

The INT_RANGE() cases for wpa_supplicant global and network profile
parameters ended up changing the configured value to the minimum value
if the provided value was too small or to the maximum value if the
provided value was too large. This does not seem most logical. Change
this to not change the configured value at all if the provided value is
outside the valid range.

Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agotests: More debug info for eht_mld_sae_legacy_client
Jouni Malinen [Sun, 3 Mar 2024 17:25:27 +0000 (19:25 +0200)] 
tests: More debug info for eht_mld_sae_legacy_client

It looks like this test case can fail in some cases. Add more debug info
and event wait that might help with a race condition.

Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agotests: Use even larger timeout of concurrent P2P operations
Jouni Malinen [Sun, 3 Mar 2024 17:09:10 +0000 (19:09 +0200)] 
tests: Use even larger timeout of concurrent P2P operations

It looks like the 30 second timeout, i.e., 25 second to discover and
receive GO Negotiation Request, was not sufficient for all cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agotests: wpa_supplicant configuration parser range checking
Jouni Malinen [Sun, 3 Mar 2024 16:16:58 +0000 (18:16 +0200)] 
tests: wpa_supplicant configuration parser range checking

Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agoFix valid range for disable_ht40
Jouni Malinen [Sun, 3 Mar 2024 16:36:46 +0000 (18:36 +0200)] 
Fix valid range for disable_ht40

This network parameter uses values 0 and 1, so -1 should not have been
accepted.

Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agoEnforce valid range check for SET mbo_cell_capa and oce
Jouni Malinen [Sun, 3 Mar 2024 16:15:18 +0000 (18:15 +0200)] 
Enforce valid range check for SET mbo_cell_capa and oce

These parameters have both a separate SET command handler and a global
configuration parameter handler. Only the global configuration parameter
handler for enforcing valid range checking. Do that for the SET command
as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agowpa_supplicant: Fix ignoring boundary 0 in config parser
Chien Wong [Thu, 29 Feb 2024 13:08:31 +0000 (21:08 +0800)] 
wpa_supplicant: Fix ignoring boundary 0 in config parser

The following config file contains invalid items:
----
filter_rssi=1234 # should be rejected

network={
 mode=-1 # should be rejected
 ssid="ssid"
 psk="password"
}
----
But it is accepted by the config parser. The issue is due to using NULL
to represent no limit. If a boundary is set to 0, it's disregarded.
Fix this.
Note that string parser is not affected as length cannot be negative and
we are not limiting any string to be always empty.

Signed-off-by: Chien Wong <m@xv97.com>
17 months agoP2P: Fix pri/sec channel switch skipping for GO
Jouni Malinen [Sat, 2 Mar 2024 19:04:30 +0000 (21:04 +0200)] 
P2P: Fix pri/sec channel switch skipping for GO

Use of wpa_s->p2p_go_no_pri_sec_switch needs to be conditional on
CONFIG_P2P being defined for the build to avoid a compilation error and
ssid->p2p_group to avoid using this for non-P2P AP mode case in
wpa_supplicant. Furthermore, it is better to clear this flag when
stopping a P2P GO to reduce risk of this getting used for a separate
instance of starting a GO.

Fixes: b18d95759375 ("P2P: Disable pri/sec channel switch for GO with forced frequency")
Signed-off-by: Jouni Malinen <j@w1.fi>
17 months agoWNM: Keep BTM information until connection completes
Benjamin Berg [Tue, 20 Feb 2024 13:18:27 +0000 (14:18 +0100)] 
WNM: Keep BTM information until connection completes

In the MLD case, the information from the transition management request
is relevant during the association process in order to filter out links
that were disallowed by the BTM request. Also, the information remains
useful should a connection attempt fail.

To enable these scenarios, keep the information around until the
connection has completed. As this might make it impossible to establish
a connection, also clear this information at the same time that a normal
BSS ignore is cleared to avoid getting stuck in case the transition
fails unexpectedly.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
17 months agoWNM: Follow BTM procedure if the last link is dropped
Benjamin Berg [Tue, 20 Feb 2024 13:18:26 +0000 (14:18 +0100)] 
WNM: Follow BTM procedure if the last link is dropped

If the last link is dropped, it makes sense to follow the BTM procedure.
However, in that case we need to prevent reconnection to this link
specifically, while if the AP MLD is terminating we need to forbid
connecting to the AP MLD.

As such, add a new variable to track the BSSID or AP MLD MAC address.
Which one it refers to depends on whether wnm_link_removal is set.

This also simplifies the check in wnm_is_bss_excluded() and untangles it
from wpa_s->current_bss.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
17 months agoWNM: Remove dialog_token parameter
Benjamin Berg [Tue, 20 Feb 2024 13:18:25 +0000 (14:18 +0100)] 
WNM: Remove dialog_token parameter

All callers of wnm_send_bss_transition_mgmt_resp() are explicitly
passing wpa_s->wnm_dialog_token. As such, we might as well not pass it
and use the variable directly.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>