]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
18 months agoAP: Support deauthenticate/disassociate with MLD
Ilan Peer [Mon, 25 Dec 2023 17:43:01 +0000 (19:43 +0200)] 
AP: Support deauthenticate/disassociate with MLD

When requested to deauthenticate/disassociate a station also handle the
corresponding MLD stations.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
18 months agoAP: Move hostapd_ml_get_assoc_sta() to shared
Ilan Peer [Mon, 25 Dec 2023 17:43:00 +0000 (19:43 +0200)] 
AP: Move hostapd_ml_get_assoc_sta() to shared

So it could be used from different contexts.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
18 months agoAP MLD: Fix station lookup in hostapd_ml_get_assoc_sta()
Ilan Peer [Mon, 25 Dec 2023 17:42:59 +0000 (19:42 +0200)] 
AP MLD: Fix station lookup in hostapd_ml_get_assoc_sta()

If the station is not an MLO station do not attempt to find the
association station and return false in the ML specific disconnection
processing.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
18 months agoAP: Unify code handling deauthentication/disassociation
Ilan Peer [Mon, 25 Dec 2023 17:42:58 +0000 (19:42 +0200)] 
AP: Unify code handling deauthentication/disassociation

This avoids unnecessary code duplication and adds the sta->wpa_sm deinit
calls for deauthentication while it was previously done only in the
disassociation case.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
18 months agotests: Run kmemleak between tests if available
Benjamin Berg [Mon, 25 Dec 2023 10:21:09 +0000 (12:21 +0200)] 
tests: Run kmemleak between tests if available

This triggers a kmemleak scan between tests. This allows finding memory
leaks and doing this should attribute the leak to the correct test in
most cases. Note that it does add a sleep after each test, as such it is
most sensible when combined with UML time-travel.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
18 months agotests: P2P: Also wait in go_neg_pbc()
Johannes Berg [Mon, 25 Dec 2023 10:21:08 +0000 (12:21 +0200)] 
tests: P2P: Also wait in go_neg_pbc()

Similar to other changes like this, wait a bit before
connectivity checks in go_neg_pbc().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
18 months agotests: ap_vht_40: wait a bit before connectivity check
Johannes Berg [Mon, 25 Dec 2023 10:21:07 +0000 (12:21 +0200)] 
tests: ap_vht_40: wait a bit before connectivity check

We need the station to be fully set up on the AP before
running the connectivity check, not just the station to
be set up itself. Just waiting for the events seems to
still be racy so just sleep a little bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
18 months agotests: Optimize process memory reading using join
Benjamin Berg [Mon, 25 Dec 2023 10:21:06 +0000 (12:21 +0200)] 
tests: Optimize process memory reading using join

Appending to a bytes() object is rather inefficient. As such, avoid
doing so by first creating a list and then joining all buffers together
at the end only.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
18 months agobuild: Properly grab the libpcsclite cflags
Benjamin Berg [Mon, 25 Dec 2023 10:21:05 +0000 (12:21 +0200)] 
build: Properly grab the libpcsclite cflags

We should be grabbing the include directory using pkg-config and not
just the libs. Without this, the header file might not be found on all
systems because it may not be in /usr/include but elsewhere in the
system.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
18 months agoDisable _FORTIFY_SOURCE when building with -O0
Andrei Otcheretianski [Mon, 25 Dec 2023 10:21:04 +0000 (12:21 +0200)] 
Disable _FORTIFY_SOURCE when building with -O0

_FORTIFY_SOURCE requires at least -O2 optimization level.
This may result in compilation warnings. Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
18 months agotests: Flag inside VM using an environment variable
Benjamin Berg [Mon, 25 Dec 2023 10:21:03 +0000 (12:21 +0200)] 
tests: Flag inside VM using an environment variable

It is possible to execute the tests directly inside the a VM without
necessarily running the repository wrapper script to do so. In these
cases, passing the VM flag using an environment variable allows
correctly flagging this fact to the tests.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
18 months agotests: Stop wpa_supplicant AP at end of VHT 80 MHz (US) test
Benjamin Berg [Mon, 25 Dec 2023 10:21:02 +0000 (12:21 +0200)] 
tests: Stop wpa_supplicant AP at end of VHT 80 MHz (US) test

The regulatory domain cannot be reset while the AP is still active. Add
the appropriate commands to bring down the AP after the test, which will
also make resetting the regulatory domain work.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
18 months agotests: Write services needed for pyrad
Benjamin Berg [Mon, 25 Dec 2023 10:21:00 +0000 (12:21 +0200)] 
tests: Write services needed for pyrad

pyrad does an internal call to getaddrinfo with the service "www".
Make sure this service is known by writing an appropriate
/etc/services file.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
18 months agotests: Explicitly set address to bind to
Benjamin Berg [Mon, 25 Dec 2023 10:20:59 +0000 (12:20 +0200)] 
tests: Explicitly set address to bind to

pyrad internally uses socket.getaddrinfo. While it is documented that
one can pass an empty string to bind to all interfaces. The underlying
function expects None instead though, breaking the call.

Either way, it does not hurt to set the bind address to 127.0.0.1
explicitly, so do so to avoid issues.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
18 months agotests: Strip trailing space from ip output
Benjamin Berg [Mon, 25 Dec 2023 10:20:58 +0000 (12:20 +0200)] 
tests: Strip trailing space from ip output

It seems that the messages from ip may have a trailing space in some
cases, which may break matching in surrounding logic. Strip the output
to remove whitespace and avoid any issues this may cause.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
18 months agoAP MLD: Correctly set the BSS parameters change count in RNR
Ilan Peer [Mon, 25 Dec 2023 09:57:09 +0000 (11:57 +0200)] 
AP MLD: Correctly set the BSS parameters change count in RNR

Set the current value instead of hardcoded 1.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
18 months agotests: DPP responder while ML associated
Jouni Malinen [Sat, 13 Jan 2024 17:39:14 +0000 (19:39 +0200)] 
tests: DPP responder while ML associated

Signed-off-by: Jouni Malinen <j@w1.fi>
18 months agonl80211: Add NL80211_ATTR_MLO_LINK_ID for NL80211_CMD_REMAIN_ON_CHANNEL
Hu Wang [Mon, 8 Jan 2024 10:14:38 +0000 (10:14 +0000)] 
nl80211: Add NL80211_ATTR_MLO_LINK_ID for NL80211_CMD_REMAIN_ON_CHANNEL

cfg80211 requires the link ID to be specified for requests to start a
remain-on-channel operation during an ML association. This feels wrong
since the ROC operation is in most cases unrelated to the
association. However, that requirement has been in place since kernel
commit 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link
APIs") from April 2022, and as such, it looks necessary to have
wpa_supplicant work around this by specifying the currently used link ID
that would seem to match the ROC channel most closely.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
18 months agotests: GAS/ANQP during MLO association
Jouni Malinen [Sat, 13 Jan 2024 10:25:47 +0000 (12:25 +0200)] 
tests: GAS/ANQP during MLO association

Signed-off-by: Jouni Malinen <j@w1.fi>
18 months agoGAS: Accept GAS response using AP MLD MAC address
Jouni Malinen [Sat, 13 Jan 2024 10:22:01 +0000 (12:22 +0200)] 
GAS: Accept GAS response using AP MLD MAC address

The GAS request may have been issued using a link address of the AP
MLD's affiliated link and the driver may translate that address to the
MLD MAC address when associated with the AP MLD. Accept GAS responses
where the addresses map to the same AP MLD.

Signed-off-by: Jouni Malinen <j@w1.fi>
18 months agoExtend pmf_in_use() to be aware of affiliated links on non-AP MLD
Jouni Malinen [Sat, 13 Jan 2024 10:24:00 +0000 (12:24 +0200)] 
Extend pmf_in_use() to be aware of affiliated links on non-AP MLD

The target MAC address needs to be checked against all the AP MLD link
addresses and the MLD MAC address to cover all possible cases. This is
needed to be able to correctly use Protected Dual of Public Action
frames during an ML association.

Signed-off-by: Jouni Malinen <j@w1.fi>
18 months agonl80211: More detailed debug print for Management frame TX
Jouni Malinen [Sat, 13 Jan 2024 10:21:12 +0000 (12:21 +0200)] 
nl80211: More detailed debug print for Management frame TX

Print all three addresses to make it easier to debug issues with
Management frame sending.

Signed-off-by: Jouni Malinen <j@w1.fi>
18 months agoAP MLD: MLD address conversion for hostapd_drv_send_action_addr3_ap()
Jouni Malinen [Sat, 13 Jan 2024 10:19:12 +0000 (12:19 +0200)] 
AP MLD: MLD address conversion for hostapd_drv_send_action_addr3_ap()

Commit 31e025c033f3 ("AP: When sending Action frames, use the AP MLD MAC
address if needed") added this for hostapd_drv_send_action(), but the
A3=BSSID variant of that function needs similar changes for GAS to work
correctly with STAs that are currently associated with MLO.

Signed-off-by: Jouni Malinen <j@w1.fi>
18 months agoAP MLD: Fix Association Response frame ACK handling
Jouni Malinen [Sat, 13 Jan 2024 10:16:51 +0000 (12:16 +0200)] 
AP MLD: Fix Association Response frame ACK handling

Invert the check on hapd->conf->mld_ap on the affiliated links to
actually call the link specific callback handler. This is needed to set
the STA associated.

Fixes: 55038680a606 ("AP: MLO: Handle association callback")
Signed-off-by: Jouni Malinen <j@w1.fi>
18 months agoAP MLD: Prefer STA entry that has sta->wpa_sm initialized
Jouni Malinen [Sat, 13 Jan 2024 17:07:10 +0000 (19:07 +0200)] 
AP MLD: Prefer STA entry that has sta->wpa_sm initialized

This is needed to allow RSN operations, like PTK rekeying, to be
completed on the correct STA entry. The previous design worked by
accident since it was using the WLAN_STA_ASSOC flag and the code that
was supposed to set that flag did not work correctly and left it unset
for the interfaces that were not used for the initial 4-way handshake.
That needs to be fixed, so this search need to be extended to be able to
prefer the STA entry that has sta->wpa_sm set instead of just the
WLAN_STA_ASSOC flag.

Signed-off-by: Jouni Malinen <j@w1.fi>
18 months agoAdd QCA vendor command for flow policy configuration
Nirav Shah [Fri, 22 Dec 2023 06:40:25 +0000 (12:10 +0530)] 
Add QCA vendor command for flow policy configuration

Define subcmd ID 239 for flow policy configuration.

Signed-off-by: Nirav Shah <quic_nnshah@quicinc.com>
19 months agoAP: Fix a regression in indoor 6 GHz AP determination
Jouni Malinen [Thu, 4 Jan 2024 09:04:20 +0000 (11:04 +0200)] 
AP: Fix a regression in indoor 6 GHz AP determination

The change to use a helper function for checking he_6ghz_reg_pwr_type
missed the difference between two types of checks for different values:
indoor AP vs. SP AP. Fix this by introducing another helper function to
cover the indoor (i.e., SP and non-SP indoor cases).

Fixes: 121ccadeb44c ("AP: A helper function for determining whether the AP is an SP AP")
Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agoLimit throughput estimation for HE 80/160 MHz based on VHT info
Jouni Malinen [Sat, 23 Dec 2023 15:39:41 +0000 (17:39 +0200)] 
Limit throughput estimation for HE 80/160 MHz based on VHT info

The current operating channel bandwidth in an HE BSS is determined with
the combination of elements, include the VHT Operation element. Use VHT
Operation element to check whether the 80, 80+80, and 160 MHz cases are
enabled if the AP claims to be capable of operating an 80/160 MHz BSS.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agoLimit throughput estimation for HE 40 MHz based on HT info
Jouni Malinen [Sat, 23 Dec 2023 15:30:18 +0000 (17:30 +0200)] 
Limit throughput estimation for HE 40 MHz based on HT info

The current operating channel bandwidth in an HE BSS is determined with
the combination of elements, include the HT Operation element. Use HT
Operation element to check whether the 40 MHz case is enabled if the AP
claims to be capable of operating a 40 MHz BSS.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agotests: Enable full testing for ACS with VHT160
Jouni Malinen [Sat, 23 Dec 2023 14:44:30 +0000 (16:44 +0200)] 
tests: Enable full testing for ACS with VHT160

This is now supported in hostapd, so drop the option to fail to start
the AP.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agotests: Automatic channel selection for EHT320
Jouni Malinen [Sat, 23 Dec 2023 14:37:55 +0000 (16:37 +0200)] 
tests: Automatic channel selection for EHT320

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agoACS: Extend the 320 MHz support
Michael-CY Lee [Fri, 22 Dec 2023 04:59:11 +0000 (12:59 +0800)] 
ACS: Extend the 320 MHz support

There are bandwidth 320 MHz-1 and 320 MHz-2 channelization in EHT mode.
When using ACS, user might prefer one of the channelization or both, but
original ACS was unable to take such preference.

Another problem is that the original ACS returns only the ideal channel
but no 320 MHz channelization. The function acs_get_bw_center_chan()
also could not correctly return the center frequency of bandwidth 320
MHz that is decided by ACS.

For example, if ACS decide the ideal channel is channel 37 with
channelization 320 MHz-2 (center frequency 6265 MHz),
acs_get_bw_center_chan() returns 6105 MHz, which is 320 MHz-1.

Extend the support for 320 MHz so that ACS can choose the best channel
according to the user's preference. Also, after calling
acs_find_ideal_chan_mode(), the best channel and bandwidth can be
derived.

The changes are:
- bw_type ACS_BW320 is divided into ACS_BW320_1 and ACS_BW320_2
- in bandwidth 320 MHz, find the best channel and bandwidth according to
  user's perference (320 MHz-1, 320 Mhz-2 or both are OK)
- before acs_find_ideal_chan_mode() returns, update bw320_offset in
  iface->conf so that the best channel's channelization is recorded.
- get the best center frequency from bw320_offset

Co-developed-by: Money Wang <money.wang@mediatek.com>
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
19 months agohostapd: Add eht_bw320_offset configuration option
Michael-CY Lee [Fri, 22 Dec 2023 04:59:10 +0000 (12:59 +0800)] 
hostapd: Add eht_bw320_offset configuration option

Introduce a new configuration option, "eht_bw320_offset", which enables
devices to specify a preferred channelization for 320 MHz BSSs when
using automatic channel selection (ACS). This option is applicable only
when the channel is not already decided and the bandwidth is set to 320
MHz.

The value and meaning of the option:
0: auto-detected by ACS
1: 320 MHz-1
2: 320 MHz-2

Co-developed-by: Money Wang <money.wang@mediatek.com>
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
19 months agoACS: Fix not selecting the best channel in the segment
Michael-CY Lee [Fri, 22 Dec 2023 04:59:09 +0000 (12:59 +0800)] 
ACS: Fix not selecting the best channel in the segment

Fix the following bugs about selecting the best channels in the segment:
1. If the 'update_best' once became false, it never becomes true again.
   In other word, if one of the channels in the segment is not usable,
   the remaining channels in the segment were never able to be the best
   channel.
2. The primary channel in the segment might not be usable due to the
   insufficient survey data. Therefore, it cannot be the best channel and
   we cannot take its factor/weight into account.

Co-developed-by: Money Wang <money.wang@mediatek.com>
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
19 months agotests: Full validation of ACS selecting HT40- channel
Jouni Malinen [Sat, 23 Dec 2023 13:20:24 +0000 (15:20 +0200)] 
tests: Full validation of ACS selecting HT40- channel

Extend the previously used minimal test case with full validation of the
selected channel and connection since hostapd now has support for the
HT40- case as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agoACS: Add HT40- support in the 2.4 GHz band
Michael-CY Lee [Fri, 22 Dec 2023 04:59:08 +0000 (12:59 +0800)] 
ACS: Add HT40- support in the 2.4 GHz band

Allow ACS to pick a HT40- channel in the 2.4 GHz band in addition to the
previously hardcoded HT40+ case.

Co-developed-by: Money Wang <money.wang@mediatek.com>
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
19 months agotests: Try to keep GAS frames within gas_concurrent_scan capture
Jouni Malinen [Sat, 23 Dec 2023 10:37:06 +0000 (12:37 +0200)] 
tests: Try to keep GAS frames within gas_concurrent_scan capture

With UML time-travel, it was possible for a GAS frame to end up in the
capture file for the next test case and if that next case used tshark to
count the number of frames (which is done, e.g., in
gas_anqp_address3_assoc), the following test case could have indicated
failure even when everything worked correctly.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agodbus: Use PHY parameters from dbus or config for the GroupAdd command
Jintao Lin [Mon, 18 Dec 2023 18:11:46 +0000 (18:11 +0000)] 
dbus: Use PHY parameters from dbus or config for the GroupAdd command

Use the PHY parameters from configuration or the values passed in from
the dbus API for P2P dbus command GroupAdd instead of using the hard
coded values to be inline with the method provided with the
wpa_supplicant control interface.

Signed-off-by: Jintao Lin <jintaolin@chromium.org>
19 months agotests: P2P GO starting a persistent group with 80+80 MHz bandwidth
Jouni Malinen [Sat, 23 Dec 2023 10:19:07 +0000 (12:19 +0200)] 
tests: P2P GO starting a persistent group with 80+80 MHz bandwidth

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agoFix P2P_GROUP_ADD handling of the persistent group parameters
Jintao Lin [Mon, 18 Dec 2023 18:11:46 +0000 (18:11 +0000)] 
Fix P2P_GROUP_ADD handling of the persistent group parameters

The vht_center_freq2 parameter was in incorrect order in the call to
wpas_p2p_group_add_persistent(). This would have dropped the value when
adding a group based on a previously created persistent group ion the GO
side and that would have resulted in a failure to start the GO.

Fix the function call to use the correct order for the parameters.

Signed-off-by: Jintao Lin <jintaolin@chromium.org>
19 months agoMove parse_freq() to be a common helper function
Jintao Lin [Mon, 18 Dec 2023 18:11:46 +0000 (18:11 +0000)] 
Move parse_freq() to be a common helper function

This allows the function to be used outside the context of the
wpa_supplicant control interface implementation.

Signed-off-by: Jintao Lin <jintaolin@chromium.org>
19 months agodbus: Use current_bss to get correct group BSSID and frequency on client
Jintao Lin [Thu, 21 Dec 2023 22:25:35 +0000 (22:25 +0000)] 
dbus: Use current_bss to get correct group BSSID and frequency on client

When the P2P persistent group is provisioned out-of-band, i.e., add
persistent group with a known BSSID, SSID, passphrase, and frequency,
and start the group with GroupAdd dbus command, the group info fetched
on the cliend side has zero MAC address for BSSID and no value for
frequency. Fix this issue by getting that information from
wpa_s->current_bss instead of wpa_s->go_params.

Signed-off-by: Jintao Lin <jintaolin@chromium.org>
19 months agoSupport all PSK AKMs in case of AP mode PSK offload
Vinayak Yadawad [Fri, 22 Dec 2023 05:45:40 +0000 (11:15 +0530)] 
Support all PSK AKMs in case of AP mode PSK offload

Previously only the SHA-1 -based AKM was supported. Extend that to cover
all PSK AKMs so that the PSK configuration to the driver happens for all
the possible cases during AP start.

Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
19 months agotests: Modify the DSCP-to-TID mapping in QoS mapping tests
Ilan Peer [Wed, 13 Dec 2023 11:37:35 +0000 (13:37 +0200)] 
tests: Modify the DSCP-to-TID mapping in QoS mapping tests

The cfg80211 default QoS mapping might be updated to align with the
recommendations in section 4 in RF C8325. Align the QoS mapping tests
accordingly. For now, allow both the previous and new mapping to pass
the test.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoUpdate definitions to point to the current IEEE 802.11 standard
Jouni Malinen [Fri, 22 Dec 2023 19:30:28 +0000 (21:30 +0200)] 
Update definitions to point to the current IEEE 802.11 standard

The previous references were to various snapshots of the standard and
draft versions.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agoAP: A helper function for determining whether the AP is an SP AP
Jouni Malinen [Fri, 22 Dec 2023 18:57:53 +0000 (20:57 +0200)] 
AP: A helper function for determining whether the AP is an SP AP

Get rid of unnecessary code duplication.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agoAP: Share a common helper function for determining length of TPE elements
Jouni Malinen [Fri, 22 Dec 2023 18:54:19 +0000 (20:54 +0200)] 
AP: Share a common helper function for determining length of TPE elements

There is no need to maintain three copies of almost identical code.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agotests: Extend the HE regulatory test to also exemplify SP AP
Ilan Peer [Fri, 22 Dec 2023 09:04:23 +0000 (11:04 +0200)] 
tests: Extend the HE regulatory test to also exemplify SP AP

Extend he_6ghz_reg to also show how to configure SP AP with EIRP TX
power limit.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoAP: Add an additional TPE element when needed
Ilan Peer [Fri, 22 Dec 2023 09:04:22 +0000 (11:04 +0200)] 
AP: Add an additional TPE element when needed

If the regulatory client EIRP PSD values advertised by an AP that is a
standard power AP or indoor standard power AP are insufficient to ensure
that regulatory client limits on total EIRP are always met for all
transmission bandwidths within the bandwidth of the AP’s BSS, the AP
shall also send a TPE element in Beacon and Probe Response frames as
that depicts the regulatory client EIRP limit.

Add support for this.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoAP: Add TPE element for Indoor standard power AP
Ilan Peer [Fri, 22 Dec 2023 09:04:21 +0000 (11:04 +0200)] 
AP: Add TPE element for Indoor standard power AP

According to IEEE P802.11-REVme/D4.0, E.2.7 (6 GHz band), two Transmit
Power Envelope (TPE) elements need to be included by Indoor Standard
Power (Indoor SP) APs. Extend the code to support this.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoAP: Publish the correct PSD value in RNR TBTT information field
Andrei Otcheretianski [Fri, 22 Dec 2023 09:04:20 +0000 (11:04 +0200)] 
AP: Publish the correct PSD value in RNR TBTT information field

According to IEEE P802.11-REVme/D4.0, 9.4.2.169.2 (Neighbor AP
Information field), the 20 MHz PSD subfield in the TBTT Information
field is a signed value with valid range of -127 to +126, while +127
indicates "no maximum transmit power is specified". Fix the default
value advertised.

Fixes: 3db24e4eefc7 ("RNR: Define element format")
Fixes: a7c152d6b806 ("RNR: Add data from neighbor database")
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agotests: Add a simple configuration test for TX power control on 6 GHz
Ilan Peer [Fri, 22 Dec 2023 09:04:19 +0000 (11:04 +0200)] 
tests: Add a simple configuration test for TX power control on 6 GHz

Add a simple test that exemplifies TX power configuration when operating
on the 6 GHz band.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agoAP: Add configuration options for 6 GHz TPE Tx power
Ilan Peer [Fri, 22 Dec 2023 09:04:18 +0000 (11:04 +0200)] 
AP: Add configuration options for 6 GHz TPE Tx power

Add configuration options for setting the Tx Power value
in the Transmit Power Envelope for 6 GHz:

- The Tx power value for default client where the transmit
  power interpretation is "Regulatory Client EIRP PSD"
- The Tx power value for subordinate client where the transmit
  power interpretation is "Regulatory Client EIRP PSD"

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoAP: Update the HE regulatory information AP types for the 6 GHz band
Ilan Peer [Fri, 22 Dec 2023 09:04:17 +0000 (11:04 +0200)] 
AP: Update the HE regulatory information AP types for the 6 GHz band

Update the HE regulatory information AP types based on IEEE
P802.11-REVme/D4.0. Set the default AP type to VLP. Check for valid
values when setting 'he_6ghz_reg_pwr_type' in the interface
configuration.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoRRM: Add support for including extended ID elements in beacon report
Ilan Peer [Fri, 22 Dec 2023 09:39:42 +0000 (11:39 +0200)] 
RRM: Add support for including extended ID elements in beacon report

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoSME: Remove comment in missing ML links handling
Benjamin Berg [Fri, 22 Dec 2023 10:25:08 +0000 (12:25 +0200)] 
SME: Remove comment in missing ML links handling

The location of the comment is incorrect and it is not really needed.
Remove it.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agoctrl_iface: Fix newline in print_ml()
Johannes Berg [Fri, 22 Dec 2023 10:06:09 +0000 (12:06 +0200)] 
ctrl_iface: Fix newline in print_ml()

We only print the newline if the AP MLD ID is present
(BASIC_MULTI_LINK_CTRL_PRES_AP_MLD_ID), fix that.

Fixes: e3e68668c1f6 ("ctrl_iface: Report RNR and ML in BSS command")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agoHS 2.0: Remove useless debug print in non-Hotspot 2.0 cases
Jouni Malinen [Fri, 22 Dec 2023 14:54:15 +0000 (16:54 +0200)] 
HS 2.0: Remove useless debug print in non-Hotspot 2.0 cases

It is not really helpful to get debug prints about Hotspot 2.0 frame
filtering when trying to connect a non-Hotspot 2.0 network. Remove this
debug print that was being printed for every connection that did not use
Hotspot 2.0.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agotests: Extend MLD SAE test to cover failed authentication
Ilan Peer [Thu, 21 Dec 2023 11:38:07 +0000 (13:38 +0200)] 
tests: Extend MLD SAE test to cover failed authentication

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoAP: Use the MLD MAC address for SAE authentication failures and testing
Ilan Peer [Thu, 21 Dec 2023 11:38:06 +0000 (13:38 +0200)] 
AP: Use the MLD MAC address for SAE authentication failures and testing

In cases of SAE failure and testing, mgmt->sa was used for sending the
Authentication frame. Fix these to use the station address (which is
the MLD MAC address in cases of non-AP MLDs).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoSplit hostapd_eid_rnr_iface() into two functions
Jouni Malinen [Fri, 22 Dec 2023 14:17:20 +0000 (16:17 +0200)] 
Split hostapd_eid_rnr_iface() into two functions

Make this a bit more readable by moving the per-BSS processing into a
helper function.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agotests: Extend testing coverage for MLD association with disabled links
Ilan Peer [Thu, 21 Dec 2023 11:08:23 +0000 (13:08 +0200)] 
tests: Extend testing coverage for MLD association with disabled links

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agoAP: Add testing option to indicate an AP is disabled
Ilan Peer [Thu, 21 Dec 2023 11:08:22 +0000 (13:08 +0200)] 
AP: Add testing option to indicate an AP is disabled

Add a testing configuration such that the AP would be reported as
disabled in the RNR TBTT information MLD parameters included by other
affiliated APs of the AP MLD.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agonl80211: Include disabled links indication in association command
Ilan Peer [Thu, 21 Dec 2023 11:08:21 +0000 (13:08 +0200)] 
nl80211: Include disabled links indication in association command

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agoMLD: Add support for disabled APs
Ilan Peer [Thu, 21 Dec 2023 11:08:20 +0000 (13:08 +0200)] 
MLD: Add support for disabled APs

An affiliated AP of an AP MLD can temporarily be disabled. Other
affiliated APs of the AP MLD indicate this in the Reduced Neighbor
Report (RNR) elements added to their Beacon and Probe Response frames.

When an affiliated AP is disabled, it should be included in the
association exchange, but can be activated only after it is enabled.

Add support identifying disabled APs and propagate the information
to the driver within the associate() callback.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agonl80211: Add link ID to the queue parameters configuration print
Ilan Peer [Thu, 21 Dec 2023 08:44:53 +0000 (10:44 +0200)] 
nl80211: Add link ID to the queue parameters configuration print

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
19 months agotests: Use longer timeout with sigma_dut in DPP reconfiguration steps
Jouni Malinen [Fri, 22 Dec 2023 12:26:34 +0000 (14:26 +0200)] 
tests: Use longer timeout with sigma_dut in DPP reconfiguration steps

Some of these can take close to the previously used timeouts and this
could result in reporting failures in cases that worked fine.

Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agotests: Add tests for EHT operation puncturing override
Ilan Peer [Thu, 21 Dec 2023 06:49:34 +0000 (08:49 +0200)] 
tests: Add tests for EHT operation puncturing override

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agoAP: Support overriding EHT operation puncturing mask
Ilan Peer [Thu, 21 Dec 2023 06:49:33 +0000 (08:49 +0200)] 
AP: Support overriding EHT operation puncturing mask

Add support for overriding EHT Operation element puncturing mask
for testing purposes.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agoAP: Allow hex format for puncturing bitmap
Andrei Otcheretianski [Thu, 21 Dec 2023 06:49:32 +0000 (08:49 +0200)] 
AP: Allow hex format for puncturing bitmap

It is much more convinient to specify the bitmap as a hex value.
Allow it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agotests: Add more EHT tests with various bandwidths and channels
Andrei Otcheretianski [Thu, 21 Dec 2023 06:49:31 +0000 (08:49 +0200)] 
tests: Add more EHT tests with various bandwidths and channels

Test EHT connection on the 5 GHz band with channel bandwidths 20-160 MHz
and up to 320 MHz on the 6 GHz band.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agoAP: Fix EHT MCS size validation for received element
Andrei Otcheretianski [Thu, 21 Dec 2023 06:49:30 +0000 (08:49 +0200)] 
AP: Fix EHT MCS size validation for received element

STA EHT MCS and NSS set field size shouldn't depend on AP HE operation
channel width. Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
19 months agoctrl_iface: Don't return -1 when dumping BSS information
Johannes Berg [Wed, 20 Dec 2023 03:27:16 +0000 (05:27 +0200)] 
ctrl_iface: Don't return -1 when dumping BSS information

Don't ever return -1 from print_bss_info() as that causes
corruption of the output.

Also don't return -1 from print_fils_indication() as that
would stop the iteration over all BSSs.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
19 months agonl80211: Fix AP deinit path (link removal) in error cases
Jouni Malinen [Fri, 22 Dec 2023 08:57:04 +0000 (10:57 +0200)] 
nl80211: Fix AP deinit path (link removal) in error cases

If the interface initialization fails, no links might be set when
calling the deinit functions. Those functions need to be prepared for
bss->n_links being 0.

Fixes: 859cbc396fc0 ("nl80211: Remove links when stopping AP MLD in hostapd")
Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agonl80211: Fix AP deinit path in error cases
Jouni Malinen [Fri, 22 Dec 2023 08:57:04 +0000 (10:57 +0200)] 
nl80211: Fix AP deinit path in error cases

If the interface initialization fails, no links might be set when
calling the deinit functions. Those functions need to be prepared for
bss->flink being NULL.

Fixes: 47269be36e61 ("nl80211: Refactor i802_bss to support multiple links")
Signed-off-by: Jouni Malinen <j@w1.fi>
19 months agotests: Flush scan cache in ap_wps_and_sae
Jouni Malinen [Thu, 21 Dec 2023 18:49:21 +0000 (20:49 +0200)] 
tests: Flush scan cache in ap_wps_and_sae

This avoids issues with old scan results from a previous test causing
incorrect association after WPS exchange.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agoAdd QCA vendor attribute for EHT SCS traffic description support
Gururaj Pandurangi [Fri, 15 Dec 2023 19:48:06 +0000 (11:48 -0800)] 
Add QCA vendor attribute for EHT SCS traffic description support

Add a vendor attribute for EHT testbed STA to configure the
SCS traffic description support in the EHT capabilities of an
Association Request frame.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agoAdd QCA vendor command for reporting firmware page fault informatin
mukul sharma [Mon, 18 Dec 2023 12:36:57 +0000 (18:06 +0530)] 
Add QCA vendor command for reporting firmware page fault informatin

This is an event indicating to the user space firmware page fault
summary report that the driver has generated from firmware indications.
This summary report is used to analyze major cause of page faults and
associated debug information.

Signed-off-by: Mukul Sharma <quic_mukul@quicinc.com>
19 months agoSupport VLAN offload with SAE password based selection
Shiva Sankar Gajula [Wed, 29 Nov 2023 09:27:42 +0000 (14:57 +0530)] 
Support VLAN offload with SAE password based selection

Allow VLAN selection based on SAE password entries when VLAN offloading
is used.

Signed-off-by: Shiva Sankar Gajula <quic_sgajula@quicinc.com>
19 months agotests: SAE and sae_password_file in hostapd configuration
Jouni Malinen [Thu, 21 Dec 2023 18:07:35 +0000 (20:07 +0200)] 
tests: SAE and sae_password_file in hostapd configuration

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agoSAE passwords from a separate file
Shiva Sankar Gajula [Wed, 29 Nov 2023 09:26:27 +0000 (14:56 +0530)] 
SAE passwords from a separate file

Add a new hostapd configuration parameter sae_password_file to read SAE
passwords (i.e., the entries that use the previously added sae_password
parameter) from a separate file.

sae_password_file uses the following format for storing passphrases:

<password/credential>[|mac=<peer mac>][|vlanid=<VLAN ID>]
[|pk=<m:ECPrivateKey-base64>][|id=<identifier>]

Examples:

<password>
<password>|id=<pw identifier>
<password>|mac=02:03:04:05:06:01|vlanid=1
<password>|vlanid=3|id=<pw identifier>

Signed-off-by: Shiva Sankar Gajula <quic_sgajula@quicinc.com>
19 months agoPASN: Select the latest available BSS entry for a BSSID
Jouni Malinen [Thu, 21 Dec 2023 17:44:32 +0000 (19:44 +0200)] 
PASN: Select the latest available BSS entry for a BSSID

This is needed to work around some issues that show up mainly in testing
scenarios when the same BSSID might be used with different
configurations and the scan results from the driver might include both
the old and new contents when two different SSIDs are used.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agoMBSSID: Element ID values in increasing order in Non-Inheritance element
Jouni Malinen [Thu, 21 Dec 2023 11:19:36 +0000 (13:19 +0200)] 
MBSSID: Element ID values in increasing order in Non-Inheritance element

Reorder the Element ID List to fill in the values in increasing order to
match the way the Element ID List is defined.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agoMLD STA: Update SAE PWE derivation in hunting-and-pecking loop case
Veerendranath Jakkam [Fri, 15 Dec 2023 14:23:59 +0000 (19:53 +0530)] 
MLD STA: Update SAE PWE derivation in hunting-and-pecking loop case

Use AP MLD address instead of BSSID for PWE derivation during MLO
connection. This was already done for H2E in commit e869fdfeefa5
("wpa_supplicant: Use MLD address in SAE authentication"). While IEEE
P802.11be requires H2E to be used, there are deployed AP MLDs that do
not follow that requirement. This change to the hunting-and-pecking loop
case is needed for interoperability workarounds with such APs.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
19 months agoFix Multiple BSSID element length calculation
Aditya Kumar Singh [Tue, 14 Nov 2023 04:57:59 +0000 (10:27 +0530)] 
Fix Multiple BSSID element length calculation

Currently while deciding to create a new Multiple BSSID element based on
the condition when the length reaches 255, the length value being used
is the total element length (including the length of the Element ID and
Length fields as well). However, the value in the length field denotes
the number of octets following it and excluding itself. Hence including
the total length is wrong. This leads to incorrect count of Multiple
BSSID elements.

And while filling the data, the length is considered porperly as it
should be hence we are filling more data in a single go and all data is
filled in MBSSID count which is less than originally calculated. This
ultimately leads to incorrect length calculation during nla_put() and
setting the beacon to the driver fails while putting the Multiple BSSID
element data into the netlink socket buffer.

Fix this issue by considering the length excluding the Element ID and
Length field sizes.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
19 months agoUse sta->vlan_id when needed for VLAN offload
Sai Pratyusha Magam [Mon, 18 Dec 2023 04:18:23 +0000 (09:48 +0530)] 
Use sta->vlan_id when needed for VLAN offload

Share VLAN info in RRB when the driver advertises support for VLAN
offload (WPA_DRIVER_FLAGS_VLAN_OFFLOAD). sta->vlan_desc is unused in
this case, only sta->vlan_id is used. Skip the checks that are based on
sta->vlan_desc.

Signed-off-by: Sai Pratyusha Magam <quic_smagam@quicinc.com>
19 months agotests: Add more time for the Presence Announcements to be received
Jouni Malinen [Wed, 20 Dec 2023 19:30:00 +0000 (21:30 +0200)] 
tests: Add more time for the Presence Announcements to be received

The previous timeout allowed only a single chirping round, and sometimes
not even that full round. That resulted in test failures for cases where
there was not really any incorrect behavior.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agotests: Clean up PSK protocol tests to avoid issues
Jouni Malinen [Wed, 20 Dec 2023 17:21:52 +0000 (19:21 +0200)] 
tests: Clean up PSK protocol tests to avoid issues

Stop dev[0] from trying to associate at the end of the test case to
reduce risk for leaving out some pending operations that could mess up
the following test case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agotests: Make flush_scan_cache() more robust
Jouni Malinen [Wed, 20 Dec 2023 16:21:10 +0000 (18:21 +0200)] 
tests: Make flush_scan_cache() more robust

Handle the cases where the first attempt to start scan fails due to an
ongoing scan. Stop such scan and try again instead of failing the test
case immediately.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agotests: Make GAS tests more robust and easier to debug
Jouni Malinen [Wed, 20 Dec 2023 11:07:14 +0000 (13:07 +0200)] 
tests: Make GAS tests more robust and easier to debug

Avoid some race conditions.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agotests: Do not check TX status in dpp_qr_code_auth_neg_chan
Jouni Malinen [Wed, 20 Dec 2023 10:46:05 +0000 (12:46 +0200)] 
tests: Do not check TX status in dpp_qr_code_auth_neg_chan

This avoids race conditions with UML time-travel where some cases ended
up not reporting the DPP-TX-STATUS event and that resulted in discarding
events that are more important to verify for correct behavior.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agotests: Wait for the dpp_init_enrollee_pkex thread to complete
Jouni Malinen [Tue, 19 Dec 2023 11:49:15 +0000 (13:49 +0200)] 
tests: Wait for the dpp_init_enrollee_pkex thread to complete

One of the sigma_dut testing cases missed the t.join() call to make
surte the separate thread terminated. This could result in confusing
"unexpected stdout output" in a middle of an unrelated test case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agotests: Make p2p_service_discovery_restart more robust
Jouni Malinen [Tue, 19 Dec 2023 11:03:20 +0000 (13:03 +0200)] 
tests: Make p2p_service_discovery_restart more robust

Stop and restart P2P_FIND on dev[1] to avoid timing issues where the
wait on dev[1] makes the test case fail even though this was trying to
verify that dev[0] is reacting quickly enough.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agonl80211: Remove send_and_recv_msgs()
Jouni Malinen [Mon, 18 Dec 2023 23:09:22 +0000 (01:09 +0200)] 
nl80211: Remove send_and_recv_msgs()

This helper is of no real use anymore, so get rid of it. This completes
send_and_recv*() cleanup. What remains is the most generic
send_and_recv() and two wrappers for it to cover the most common simpler
cases.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agonl80211: Add send_and_recv_resp() helper
Jouni Malinen [Mon, 18 Dec 2023 23:07:36 +0000 (01:07 +0200)] 
nl80211: Add send_and_recv_resp() helper

This is a variant for the second most common case of send_and_recv() needs:
send a command with a special response handling.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agonl80211: Add send_and_recv_cmd() helper
Jouni Malinen [Mon, 18 Dec 2023 23:00:23 +0000 (01:00 +0200)] 
nl80211: Add send_and_recv_cmd() helper

This is a variant for the most common case of send_and_recv() needs:
send a command without needing a special response handling. In addition,
move the helper functions into driver_nl80211.h since these are now
simple wrappers for the more flexible send_and_recv().

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agonl80211: Remove send_and_recv_msgs_connect_handle()
Jouni Malinen [Mon, 18 Dec 2023 22:38:11 +0000 (00:38 +0200)] 
nl80211: Remove send_and_recv_msgs_connect_handle()

This is not really that helpful as a separate helper function, so get
rid of one of the many send_and_recv() variants.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agonl80211: Do not set socket owner for NL80211_CMD_LEAVE_IBSS
Jouni Malinen [Mon, 18 Dec 2023 22:28:30 +0000 (00:28 +0200)] 
nl80211: Do not set socket owner for NL80211_CMD_LEAVE_IBSS

This operation terminates the IBSS and as such, does not really use
NL80211_ATTR_SOCKET_OWNER.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agonl80211: Remove send_and_recv_msgs_owner()
Jouni Malinen [Mon, 18 Dec 2023 22:25:44 +0000 (00:25 +0200)] 
nl80211: Remove send_and_recv_msgs_owner()

This is not helpful as a separate helper function anymore, so get rid of
one of the many send_and_recv() variants.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
19 months agonl80211: Move control port attribute adding into more accurate location
Jouni Malinen [Mon, 18 Dec 2023 22:20:16 +0000 (00:20 +0200)] 
nl80211: Move control port attribute adding into more accurate location

This is independent of the NL80211_ATTR_SOCKET_OWNER use, so add these
attributes from a separate helper function that is called only from
locations that actually start an operation that uses EAPOL frames.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>