]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
15 months agonl80211: Restore libnl3-route inclusion for full VLAN support with netlink
Jouni Malinen [Fri, 19 Apr 2024 16:04:14 +0000 (19:04 +0300)] 
nl80211: Restore libnl3-route inclusion for full VLAN support with netlink

The changes in nl80211 to get rid of the libnl3-route dependency are not
sufficient to fully remove the depency from other parts of the code.
Revert the makefile related changes from that commit to avoid build
issues for cases where CONFIG_FULL_DYNAMIC_VLAN=y and
CONFIG_VLAN_NETLINK=y are used without CONFIG_DRIVER_MACSEC_LINUX=y
pulling in the needed library.

Fixes: a210fdb1c717 ("nl80211: Rewrite neigh code to not depend on libnl3-route")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAdd a vendor attribute to configure custom keep-alive interval for STA
Aleti Nageshwar Reddy [Thu, 7 Mar 2024 09:30:15 +0000 (15:00 +0530)] 
Add a vendor attribute to configure custom keep-alive interval for STA

Introduce an attribute QCA_WLAN_VENDOR_ATTR_CONFIG_KEEP_ALIVE_INTERVAL
in QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION to configure
station's keep-alive interval to the driver/firmware. This can be used
to resolve kickout issues from APs which kick out STAs before the BSS
maximum idle period expires.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAdd QCA vendor interface for reporting station info in unicast event
Veerendranath Jakkam [Mon, 8 Apr 2024 22:09:47 +0000 (03:39 +0530)] 
Add QCA vendor interface for reporting station info in unicast event

Add a QCA vendor command for registering NL80211_CMD_GET_STATION
response as a unicast event when there is a NL80211_CMD_GET_STATION
request from any userspace module.

The driver will send the unicast events with the same netlink port ID
which is used by userspace application for sending the registration
command. If multiple registration commands are received with different
netlink port IDs, the driver will send unicast event with each netlink
port ID separately.

Userspace application can deregister the unicast events with disable
configuration. The registrations will be removed automatically by the
driver when the corresponding netlink socket is closed.

This will help avoid multiple NL80211_CMD_GET_STATION requests from
different userspace applications in short span. The userspace
application which registers for the unicast event can avoid sending
NL80211_CMD_GET_STATION request again if the response is available with
a recently received unicast event.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
15 months agoAdd TWT responder support for AP in HT and VHT modes
Manaswini Paluri [Wed, 28 Feb 2024 05:41:43 +0000 (11:11 +0530)] 
Add TWT responder support for AP in HT and VHT modes

Add support for TWT responder for AP operating in HT and VHT modes by
introducing a new configuration parameter ht_vht_twt_responder. When
this is enabled, TWT responder mode support in HT and VHT modes is
enabled if the driver supports this and is disabled otherwise.

Signed-off-by: Manaswini Paluri<quic_mpaluri@quicinc.com>
15 months agoAdd QCA vendor feature flag for TWT responder support in HT and VHT modes
Manaswini Paluri [Mon, 9 Oct 2023 12:06:31 +0000 (17:36 +0530)] 
Add QCA vendor feature flag for TWT responder support in HT and VHT modes

Add a feature flag to indicate driver support for TWT responder for AP
operating in HT and VHT modes.

Signed-off-by: Manaswini Paluri<quic_mpaluri@quicinc.com>
15 months agotests: Update RSA 3k certificates (2024)
Jouni Malinen [Wed, 17 Apr 2024 18:26:36 +0000 (21:26 +0300)] 
tests: Update RSA 3k certificates (2024)

These have not yet expired, but it is easier to get in sync with all
certificate updates.

Signed-off-by: Jouni Malinen <j@w1.fi>
15 months agotests: Update server and user certificates (2024)
Jouni Malinen [Wed, 17 Apr 2024 18:25:56 +0000 (21:25 +0300)] 
tests: Update server and user certificates (2024)

At least some of the previous versions have expired, so need to re-sign
these to avoid EAP test case failures. This contains updates from
running tests/hwsim/auth_server/update.sh.

Signed-off-by: Jouni Malinen <j@w1.fi>
15 months agotests: Fix sigma_dut_dpp_pb_ap to clear sae_groups
Jouni Malinen [Tue, 16 Apr 2024 08:22:41 +0000 (11:22 +0300)] 
tests: Fix sigma_dut_dpp_pb_ap to clear sae_groups

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agonl80211: Send link_id on sta_deauth()
Aditya Kumar Singh [Thu, 28 Mar 2024 18:16:34 +0000 (23:46 +0530)] 
nl80211: Send link_id on sta_deauth()

i802_sta_deauth() already has the link_id passed to it in its arguments.
Use that to pass it down to send MLME handler as well.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agonl80211: Print the interface name in debug during link add
Aditya Kumar Singh [Thu, 28 Mar 2024 18:16:33 +0000 (23:46 +0530)] 
nl80211: Print the interface name in debug during link add

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agonl80211: Generate link add command on per-BSS basis for AP MLD
Aditya Kumar Singh [Thu, 28 Mar 2024 18:16:32 +0000 (23:46 +0530)] 
nl80211: Generate link add command on per-BSS basis for AP MLD

Function nl80211_link_add() created the link add netlink message on drv
basis which in turn always uses the drv's first BSS. To support link add
for various other interfaces, use the per-BSS function to create the
netlink message.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoAP MLD: Simplify for_each_mld_link() macro
Aditya Kumar Singh [Thu, 28 Mar 2024 18:16:31 +0000 (23:46 +0530)] 
AP MLD: Simplify for_each_mld_link() macro

for_each_mld_link() macro used three nested for loops. Since now the
affliated links are linked together via a linked list, the logic can be
improved by using dl_list_for_each() macro instead which uses one for
loop.

Modify for_each_mld_link() macro to use dl_list_for_each() instead.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agotests: Add test with stuck ECSA in Probe Response frames
Johannes Berg [Thu, 28 Mar 2024 13:07:00 +0000 (14:07 +0100)] 
tests: Add test with stuck ECSA in Probe Response frames

Add a test behaving like an Asus RT-AC53 with firmware
3.0.0.4.380_10760-g21a5898, which (in some cases?) can have an ECSA
element stuck in the probe response, when the channel switch is long
finished.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
15 months agotests: Add connecting-while-CSA tests
Johannes Berg [Thu, 28 Mar 2024 13:06:59 +0000 (14:06 +0100)] 
tests: Add connecting-while-CSA tests

Add a few tests to validate what happens with connections
while an AP is doing CSA:
 - quiet to diff channel (shouldn't connect)
 - quiet to same channel (shouldn't connect)
 - non-quiet to diff channel (shouldn't connect)
 - non-quiet to same channel (should connect)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
15 months agohostapd: Add support for testing Probe Response frame elements
Johannes Berg [Thu, 28 Mar 2024 13:06:58 +0000 (14:06 +0100)] 
hostapd: Add support for testing Probe Response frame elements

Add support for additional (vendor) elements to be added
to only Probe Response frames, for testing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
15 months agotests: Fix he_6ghz_reg to clear sae_groups
Jouni Malinen [Mon, 15 Apr 2024 20:35:29 +0000 (23:35 +0300)] 
tests: Fix he_6ghz_reg to clear sae_groups

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agobuild: De-duplicate _DIRS before calling mkdir
Felix Fietkau [Thu, 4 Apr 2024 13:03:27 +0000 (15:03 +0200)] 
build: De-duplicate _DIRS before calling mkdir

If the build path is long, the contents of the _DIRS variable can be
very long, since it repeats the same directories very often. In some
cases, this has triggered an "Argument list too long" build error.

Reported-by: Robert Marko <robimarko@gmail.com>
Suggested-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agohostapd: Only attempt to set QoS map if supported by the driver
Felix Fietkau [Thu, 4 Apr 2024 10:52:17 +0000 (12:52 +0200)] 
hostapd: Only attempt to set QoS map if supported by the driver

This fixes issues with full-MAC drivers like brcmfmac.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agoSupport qos_map_set without CONFIG_INTERWORKING
Felix Fietkau [Thu, 4 Apr 2024 10:52:16 +0000 (12:52 +0200)] 
Support qos_map_set without CONFIG_INTERWORKING

This feature is useful on its own even without full interworking
support.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agomesh: Allow processing authentication frames in blocked state
Felix Fietkau [Thu, 4 Apr 2024 10:52:15 +0000 (12:52 +0200)] 
mesh: Allow processing authentication frames in blocked state

If authentication fails repeatedly, e.g., because of a weak signal, the
link can end up in blocked state. If one of the nodes tries to establish
a link again before it is unblocked on the other side, it will block the
link to that other side. The same happens on the other side when it
unblocks the link. In that scenario, the link never recovers on its own.

To fix this, allow restarting authentication even if the link is in
blocked state, but don't initiate the attempt until the blocked period
is over. This reverts commit 09d96de09e01 ("mesh: Drop Authentication
frames from BLOCKED STA").

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agonl80211: Rewrite neigh code to not depend on libnl3-route
Felix Fietkau [Thu, 4 Apr 2024 10:52:14 +0000 (12:52 +0200)] 
nl80211: Rewrite neigh code to not depend on libnl3-route

This removes an unnecessary dependency and also makes the code smaller.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agondisc_snoop: Call dl_list_del() before freeing IPv6 addresses
Felix Fietkau [Thu, 4 Apr 2024 10:52:13 +0000 (12:52 +0200)] 
ndisc_snoop: Call dl_list_del() before freeing IPv6 addresses

This fixes a segmentation fault on STA disconnect in case IPv6 addresses
where learned for the STA based on snooped neighbor solicication.

Fixes: bd00c4311c0e ("AP: Add Neighbor Discovery snooping mechanism for Proxy ARP")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agoCancel channel_list_update_timeout() in hostapd_cleanup_iface_partial()
Felix Fietkau [Thu, 4 Apr 2024 10:52:12 +0000 (12:52 +0200)] 
Cancel channel_list_update_timeout() in hostapd_cleanup_iface_partial()

This fixes a crash when disabling an interface during channel list
update.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agonl80211: Update drv->ifindex on removing the first BSS
Felix Fietkau [Thu, 4 Apr 2024 10:52:11 +0000 (12:52 +0200)] 
nl80211: Update drv->ifindex on removing the first BSS

Otherwise it will point at the ifindex of the just removed BSS.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agohostapd: Add RRM link measurement request support
Raj Kumar Bhagat [Thu, 4 Apr 2024 06:28:09 +0000 (11:58 +0530)] 
hostapd: Add RRM link measurement request support

RRM link measurement request/report management frames are used to get
the radio link information between the connected stations.

Add new hostapd_cli command req_link_measurement to send an RRM link
measurement request to an associated station. Add support to handle the
link measurement report in hostapd.

RRM link measurement support can be enabled with the following new
configuration parameter:
rrm_link_measurement_report=1

Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
Signed-off-by: Yuvarani V <quic_yuvarani@quicinc.com>
15 months agoAP MLD: Set DTIM information properly in per-STA profile
Karthikeyan Kathirvel [Mon, 1 Apr 2024 12:53:02 +0000 (18:23 +0530)] 
AP MLD: Set DTIM information properly in per-STA profile

The DTIM information in the per-STA profile is set incorrectly. The DTIM
period is set in the LSB octet of the DTIM Info subfield (2 octets),
which is intended for the DTIM count.

Fix this by setting the DTIM period and DTIM count information properly
to the MSB and LSB octets of the DTIM Info subfield, respectively.

Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
15 months agohostapd: Fix channel switch to a DFS channel
Rajat Soni [Thu, 4 Apr 2024 09:20:50 +0000 (14:50 +0530)] 
hostapd: Fix channel switch to a DFS channel

When we are configuring automatic channel selection, we are not able to
switch to a given DFS channel because when we are trying to move to a
DFS channel, the interface is disabled and enabled again. When the
interface is disabled and enabled we are setting iface's freq and
channel to 0 in setup_interface2() in case ACS is enabled, and now we
don't know to which channel we were trying to move. Now ACS will run and
the interface will be up in the channel that is suitable.

To fix this issue add a flag named is_ch_switch_dfs to check if the
channel switch request is for a DFS channel and we can use this in
setup_interface2() to decide whther we have to set iface's freq and
channel to 0 or not. This way iface's freq and channel will retain the
values while channel switching to a DFS channel when ACS is enabled.

Signed-off-by: Rajat Soni <quic_rajson@quicinc.com>
15 months agoAP MLD: Track radar detection in offloaded DFS case
Chenming Huang [Wed, 13 Mar 2024 09:38:17 +0000 (15:08 +0530)] 
AP MLD: Track radar detection in offloaded DFS case

Add a new flag radar_detected which is used in the following cases
when setting up a link on a DFS channel while the interface is not yet
enabled:
    1. DFS link received CAC start event
    2. If no radar detected, link setup succeeeds after CAC end
       event is received. Else go to 3.
    3. Radar detected on this link -> set radar_detected bit
    4. CAC end received for the current freq -> Do not setup interface
       as radar already detected. Clear radar_detected bit.
    5. The driver sends channel switch event to switch to another channel
        a. Switch to another DFS channel -> go to 1
        b. Switch to non-DFS channel -> proceed to set up interface

Or when receiving a CAC start event when the interface is already set up:
    1. DFS link already set up successfully
    2. Radar detected on this link -> set radar_detected bit
       a. Switch to DFS channel
           a.1. CAC start -> clear radar_detected bit and partner RNR
           a.2. If radar detected, go to 2.
           a.3. CAC end -> clear radar_detected bit
           a.4. Link enabled successfully
       b. Switch to non-DFS channel
           b.1  No op and the driver handles this

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoAP MLD: Do not update other links' RNR element if not enabled yet
Chenming Huang [Wed, 13 Mar 2024 09:38:17 +0000 (15:08 +0530)] 
AP MLD: Do not update other links' RNR element if not enabled yet

When one link is still under CAC or disabled, peer links should not
carry the information of this link in the RNR elements.

With this change, the RNR element will be included only if a peer link
is in HAPD_IFACE_ENABLED state.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agonl80211: AP MLD: Parse link ID to determine the BSS for radar event
Chenming Huang [Thu, 21 Mar 2024 01:39:45 +0000 (07:09 +0530)] 
nl80211: AP MLD: Parse link ID to determine the BSS for radar event

Link ID is more accurate to specify the BSS for a radar event in some
corner cases, e.g., when there is a radar detection event and the driver
then switches to another DFS channel. There will then be two events
coming from the driver (CAC start and channel switch complete). In case
the CAC-start event comes first, hostapd still stores the previous
frequency and cannot find the correct link by calling
nl80211_get_mld_link_by_freq() with the new frequency.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoAP MLD: Fix missing check for legacy client case
Chenming Huang [Wed, 27 Mar 2024 02:56:05 +0000 (08:26 +0530)] 
AP MLD: Fix missing check for legacy client case

The AP MLD case missed the "else" branch which handles legacy STA's
disassociation. So this STA's sta_info will not be cleared ever.

Add the "else" check to make sure the sta_info gets cleared.

Fixes: 7ceafb6e9fd3 ("AP MLD: Handle disassociation notification with SME offload to driver")
Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoAP MLD: Request Handle OBSS scan for a specific link
Chenming Huang [Thu, 25 Jan 2024 08:23:03 +0000 (13:53 +0530)] 
AP MLD: Request Handle OBSS scan for a specific link

OBSS scan can be required in different links if operating as an AP MLD.
When triggering scan, specify the link ID for the driver to find the
correct link to scan.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoAP MLD: Allow scan processing link to match the request
Chenming Huang [Thu, 25 Jan 2024 08:23:03 +0000 (13:53 +0530)] 
AP MLD: Allow scan processing link to match the request

If the driver provides an identifying cookie value for scan operations,
use that to select which link processes the scan result. This is needed
for OBSS scans that can be required in different links if operating as
an AP MLD.  Distinguish the scans using scan_cookie for QCA vendor scan
events.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoAP MLD: Find the link that is waiting for scan events
Chenming Huang [Tue, 20 Feb 2024 06:25:09 +0000 (11:55 +0530)] 
AP MLD: Find the link that is waiting for scan events

In AP MLD case, HT scan results need to be handled in the link that
triggered this scan. So find the link that has a valid scan_cb to handle
EVENT_SCAN_RESULTS.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoPASN: Add set and get API for PASN data context
Vinay Gannevaram [Fri, 29 Mar 2024 09:47:42 +0000 (15:17 +0530)] 
PASN: Add set and get API for PASN data context

Modules that use libpasn for PASN authentication need the context of
PASN data. PASN data is a common context for the library and the modules
using it. Hence, initialize the context through init and deinit
functions. Also use set and get functions to update the parameters.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoReplace PMKSA cache inline stubs with wrapper function stubs
Vinay Gannevaram [Mon, 5 Feb 2024 16:28:02 +0000 (21:58 +0530)] 
Replace PMKSA cache inline stubs with wrapper function stubs

PMKSA cache API is included in libpasn.so used by external modules,
e.g., Wi-Fi Aware. To avoid dependency on IEEE8021X_EAPOL define for the
external modules at compile time, remove PMKSA cache static inline
functions from the header file and add wrapper function stubs.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoReplace PTKSA cache inline stubs with wrapper function stubs
Vinay Gannevaram [Thu, 1 Feb 2024 03:08:33 +0000 (08:38 +0530)] 
Replace PTKSA cache inline stubs with wrapper function stubs

PTKSA cache API is included in libpasn.so used by external modules,
e.g., Wi-Fi Aware. To avoid dependency on CONFIG_PTKSA_CACHE define for
the external modules at compile time, remove PTKSA cache static inline
functions from the header file and add wrapper function stubs.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agotests: MBSSID and beacon protection disabled/enabled
Jouni Malinen [Thu, 4 Apr 2024 17:44:22 +0000 (20:44 +0300)] 
tests: MBSSID and beacon protection disabled/enabled

Verify that the Extended Capabilities element for the TX BSS shows
beacon protection disabled and the Extended Capabilities element for the
non-TX BSS (within the Multiple BSSID element) shows it enabled.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoMBSSID: Include Extended Capabilities element in non-TX BSSID profile
Jouni Malinen [Thu, 4 Apr 2024 17:42:59 +0000 (20:42 +0300)] 
MBSSID: Include Extended Capabilities element in non-TX BSSID profile

Add the Extended Capabilities element for a non-TX BSS into the non-TX
BSSID profile subelement in the Multiple BSSID element if the non-TX BSS
has different extended capabilities than the TX BSS.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoAP MLD: Provide link addresses for non-AP MLDs in control interface
Chenming Huang [Mon, 29 Jan 2024 06:34:25 +0000 (12:04 +0530)] 
AP MLD: Provide link addresses for non-AP MLDs in control interface

Add affiliated link addresses for non-AP MLDs in the STA* control
interface commands.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
16 months agoAdd a QCA vendor attribute to set avoid frequencies per netdev
Purushottam Kushwaha [Thu, 21 Mar 2024 07:28:38 +0000 (12:58 +0530)] 
Add a QCA vendor attribute to set avoid frequencies per netdev

Add a new attribute QCA_WLAN_VENDOR_ATTR_AVOID_FREQUENCY_IFINDEX
for QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_EXT subcommand to
apply rules for avoid frequencies on a specific netdev. This is a
32-bit unsigned optional attribute.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
16 months agotests: Avoid control interface throttling in various test cases
Jouni Malinen [Wed, 27 Mar 2024 21:26:00 +0000 (23:26 +0200)] 
tests: Avoid control interface throttling in various test cases

These can cause unexpected test failures, so dump the pending monitor
socket events more frequently in some cases where event throttling is
seen.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoRevert "nl80211: Skip interface down/up when setting MAC address"
Hu Wang [Wed, 27 Mar 2024 05:53:34 +0000 (22:53 -0700)] 
Revert "nl80211: Skip interface down/up when setting MAC address"

This reverts commit bffd2b39944330b0ffbaba62036a73d2c5e23bfb.

Revert this commit to fix a regression when setting up P2P Group Owner
on some old device.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agoUse the latest updated BSS entry for sending ANQP requests
Jouni Malinen [Wed, 27 Mar 2024 20:37:18 +0000 (22:37 +0200)] 
Use the latest updated BSS entry for sending ANQP requests

Try to find the BSS entry that contains the most likely current
information for the target BSS. This is mainly needed to avoid some
unusual behavior with APs changing their Beacon frame information in a
manner that shows up in automated testing, but this might help with some
more dynamic real world uses as well, so better do the BSS entry search
for the newest entry.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
16 months agotests: Flush scan cache to make dbus_anqp_get more reliable
Jouni Malinen [Wed, 27 Mar 2024 20:33:38 +0000 (22:33 +0200)] 
tests: Flush scan cache to make dbus_anqp_get more reliable

This test could have failed if scan results from a previously executed
test case were still the in the driver cache.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
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>