Commit graph

19546 commits

Author SHA1 Message Date
Aditya Kumar Singh
1dda619ed2 tests: Cohosted MLDs connectivity testing
Add a test case 'eht_mld_cohosted_connectivity' which creates two 2 link
AP MLDs and connect a 2 link MLD client to each one of them and test
data traffic.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-24 21:58:49 +03:00
Aditya Kumar Singh
a1e585fb63 tests: Basic cohosted MLDs functionality testing
Add test cases to test basic cohosted MLDs functionality. Add helper
functions to create the configuration file, start hostapd instance.

Client connectivity test case will be added via a subsequent commit.

eht_mld_cohosted_discovery: 2 co-hosted MLDs without non-MLD RNR. Basic
bring up and beacon, MLD RNR, scan validation.

eht_mld_cohosted_discovery_with_rnr: Same like eht_mld_cohosted_discovery
but additionally non-MLD RNR (rnr=1) is also enabled. Validate the non-MLD
RNR as well.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-24 21:58:49 +03:00
Rathees Kumar R Chinannan
51b5b9512f Update Probe Response template on BSS color change
When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new Beacon frame template.

Extend this to update the Probe Response template during BSS color
change.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
2024-04-24 21:58:49 +03:00
Rathees Kumar R Chinannan
6f1fbebeb6 Update Probe Response template on channel switch
When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new Beacon frame template.

Extend this to update the Probe Response template during channel switch.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
2024-04-24 21:58:49 +03:00
Rathees Kumar R Chinannan
7d0c08910b More generic unsolicited broadcast Probe Response template setup
When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new beacon.

As a preparation for extending this functionality to other cases, move
the generation of the unsolicited broadcast Probe Response template into
a more generic function and data structure.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
2024-04-24 21:58:49 +03:00
Jouni Malinen
b38f14e13d tests: Update opclass 124 test to use opclass 125
This is needed to match the implementation change to map the 5 GHz
channels 149-175 to the global operating class 125 instead of 124.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-24 21:58:49 +03:00
Jouni Malinen
ef5d2f9e8f tests: Fix a typo in opclass test descriptions
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-24 21:58:49 +03:00
Amith A
195cc3d919 Make selection of current opclass more generic for 20 MHz UNI-III channels
According to IEEE Std 802.11-2020, Operating classes Table E-2 (Europe)
and Table E-6 (China) map channels in the range 149 to 161 to the global
operating class 125, while Table E-1 (United States) maps these channels
to global operating classes 125 and 124 as well. The global operating
class 125 contains all channels from the global operating class 124 and
some additional channels.

Hence, to make the selection of the current operating class generic, use
operating class 125 for all 20 MHz channels in the range 149 to 161.

Signed-off-by: Amith A <quic_amitajit@quicinc.com>
2024-04-24 00:19:05 +03:00
Sriram R
b9113105ad FILS: Add Operating Class and Primary Channel in FD for non-PSC chan
If a non-PSC 6 GHz channel with bandwidth higher than 20 MHz is
configured, duplicate beacons/FD/UBPR will be transmitted in other 20
MHz channels of the current configured bandwidth to aid in faster scan.
In such cases the duplicate FD needs to carry the Operating Class and
Primary Channel subfields for non-AP STAs to identify the primary
non-PSC.

IEEE Std 802.11-2020, 9.6.7.36 (FILS Discovery frame format):
"The Operating Class subfield specifies the operating class of the
Primary Channel of the transmitting AP (see 9.4.1.36).

The Primary Channel subfield is set to the channel number of the primary
channel (see 11.15.2) if the FILS Discovery frame is transmitted as a
non-HT duplicate PPDU; otherwise, the subfield is not present."

Hence, add the Operating Class and Primary Channel subfields if the
current channel is non-PSC and the channel bandwidth is 40 MHz or
higher.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
2024-04-24 00:17:15 +03:00
Rakesh Pillai
5929b4eb1d Define QCA vendor commands for flow stats/classification
Add nl80211 vendor commands and attributes for the collection of flow
stats and classification.

- QCA_NL80211_VENDOR_SUBCMD_FLOW_STATS
- QCA_NL80211_VENDOR_SUBCMD_FLOW_CLASSIFY_RESULT
- QCA_NL80211_VENDOR_SUBCMD_ASYNC_STATS_POLICY
- QCA_NL80211_VENDOR_SUBCMD_CLASSIFIED_FLOW_REPORT

Signed-off-by: Rakesh Pillai <quic_pillair@quicinc.com>
2024-04-23 15:49:38 +03:00
Chenming Huang
5308029f86 nl80211: Update link bandwidth when receiving channel switch event
There is a chance that the driver has switched the channel width so we
should update the bandwidth, too, when receiving a channel switch event.
Otherwise, this may cause out of sync for bandwidth between i802_link
and hostapd_config.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
2024-04-22 23:39:20 +03:00
Chenming Huang
11dfdf64c0 AP MLD: Set link_id field in hostapd_freq_params when setting up AP
If not set, 0 is set by default and this could fail in the following
code path when link ID is not matching:
hostapd_drv_set_ap -> wpa_driver_nl80211_set_ap -> nl80211_set_channel

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
2024-04-22 23:33:15 +03:00
Purushottam Kushwaha
df14f1e2bd Add QCA vendor subcommand to suspend/resume AP interface
Add a new QCA vendor subcommand QCA_NL80211_VENDOR_SUBCMD_AP_SUSPEND to
allow suspend and resume the AP interface. When an AP is suspended, it
disconnects all connected clients and stops all TX/RX operations on the
AP interface. The driver retains the AP configuration and on resume, all
AP operations are resumed with the same configuration.

This subcommand is also used in the event path to notify userspace about
AP suspended or resumed state changes.

This uses attributes defined in enum qca_wlan_vendor_attr_ap_suspend.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
2024-04-22 23:19:49 +03:00
Jouni Malinen
e141b33a66 tests: Fix a race condition in mesh_link_probe
Wait for both peers to be connected before checking MESH_LINK_PROBE
behavior. Without this, it was possible for a MESH_LINK_PROBE command to
be issues before the specific peer had been added and that would result
in the nl80211 command failing.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-22 23:14:08 +03:00
Jouni Malinen
97da087c0c tests: Fix autogo_chan_switch to not drop HT capability
This test case ended up dropping HT capability on channel switch which
is now resulting in mac80211 disconnecting. Avoid this by leaving HT
enabled. In addition, check the P2P Client events explicitly.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-22 16:17:39 +03:00
Jouni Malinen
42080798b5 tests: AP MLD with two links when only one of the links is negotiated
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-22 14:38:59 +03:00
Jouni Malinen
df59880042 AP MLD: Add MLO Link KDE for each affiliated link in EAPOL-Key 3/4
Previously, MLO Link KDE was added only for each link that was
negotiated for the ML association. However, IEEE Std 802.11be/D5.0,
12.7.6.1 defines the MLO Link KDE to be included "for each affiliated
AP" which is not constrained by what the non-AP MLD might have requested
or what the negotiation outcome for this particular ML association is.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-22 14:38:59 +03:00
Jouni Malinen
b26971774c AP MLD: Do not store per-supplicant AP RSNE/RSNXE information
There is no need to store the AP MLD's RSNE/RSNXE within per-supplicant
data structure in struct wpa_state_machine since those elements are
available from the generic authenticator data in struct
wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-22 14:38:59 +03:00
Jouni Malinen
20872d5256 AP MLD: Do not store per-supplicant AP link MAC address information
There is no need to store the AP MLD's link MAC addresses within
per-supplicant data structure in struct wpa_state_machine since those
MAC addresses are available from the generic authenticator data in
struct wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-22 14:38:59 +03:00
Jouni Malinen
3b68eef7d7 AP MLD: Do not store per-supplicant AP MLD MAC address information
There is no need to store the AP MLD MAC address within per-supplicant
data structure in struct wpa_state_machine since that MLD MAC address is
available from the generic authenticator data in struct
wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-22 14:38:59 +03:00
Aleti Nageshwar Reddy
ed78f56dce Add a vendor attribute value to set aggressive roaming mode
Add QCA_ROAMING_MODE_AGGRESSIVE in enum qca_roaming_policy to set
aggressive roaming mode. In addition, document the existing enum values.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-22 12:48:25 +03:00
Jouni Malinen
8f83b7d7d1 tests: WPA2-PSK from RADIUS during 4-way handshake with Session-Timeout
Signed-off-by: Jouni Malinen <j@w1.fi>
2024-04-21 11:55:53 +03:00
Lee Harding
e6ec62aa2d Allow Session-Timeout with PSK RADIUS during 4-way handshake
When the RADIUS response included a Session-Timeout attribute, but is
otherwise valid (an Access-Accept with a valid Tunnel-Password), the
association still failed due to the strict comparison of the accepted
value with HOSTAPD_ACL_ACCEPT. Apparently this combination wasn't
previously tested.

Extend this to allow a packet containing a valid Session-Timeout
attribute to be accepted by extending the "success" comparison to
include HOSTAPD_ACL_ACCEPT_TIMEOUT.

Fixes: 1c3438fec4 ("RADIUS ACL/PSK check during 4-way handshake")
Signed-off-by: Lee Harding <somerandomstring@gmail.com>
2024-04-21 11:55:53 +03:00
arun.jose
f44a07d5c4 wpa_cli: Make WPA_EVENT_CHANNEL_SWITCH events accessible to action scripts
Make the channel switch complete event, WPA_EVENT_CHANNEL_SWITCH,
accessible to the action script.

Signed-off-by: arun.jose <arun.jose.wg@bp.renesas.com>
2024-04-21 11:55:53 +03:00
Jurijs Soloveckis
2e1f7d091c Fix center segment indexes in channel switch fallback to non-5 GHz cases
Hardcoded conversion for 5 GHz band was used, but this won't work for
other cases. Set the correct center segment indexes in channel switch
fallback for non-5GHz band.

Signed-off-by: Jurijs Soloveckis <jsoloveckis@maxlinear.com>
2024-04-21 11:55:53 +03:00
Benjamin Berg
7cf3ceadaa P2P: Call normal SD query callback on RX/TX race
If the TX success response races with the RX frame then the state
machine was simply move to P2P_SD_DURING_FIND to continue the operation.
However, this does not take into account broadcast queries where the
callback handler updates the peer's sd_pending_bcast_queries.

Fix this by exporting the callback and calling it directly. This is
fine, as the operation is cancelled immediately afterwards, ensuring
that the callback is not called a second time.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-04-21 11:55:53 +03:00
Andrei Otcheretianski
9b1e0ab4e8 dbus: Use correct values for persistent group
D-Bus expects "persistent" to be a bool (0/1) and crashes otherwise.
Since persistent may also be 2 convert it to boolean.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-04-21 11:55:53 +03:00
Ilan Peer
cf36ffd43c wpa_supplicant: Do not allow fast associate before scanning 6 GHz
In case the channel map was updated to include the 6 GHz but these channels
were not scanned yet, do not allow fast associate.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2024-04-21 11:55:53 +03:00
Benjamin Berg
ff798fbb83 ctrl_iface: Allow sending ML probe without AP MLD ID
If one sends a Probe Request frame to a non-TX BSSID, no AP MLD ID
should be included in the request. Permit mld_id to be -1 so that it is
not a required argument and can be left out.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
2024-04-21 11:55:53 +03:00
Ilan Peer
4d2f76fabf MLD: Use AP MLD MAC address with deauthenticate
When the authentication is an MLD authentication need to use the AP MLD
MAC address when requesting the driver to deauthenticate.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2024-04-21 11:55:53 +03:00
Ilan Peer
5d9b4a1a14 SME: MLD: Clear MLD state only after the deauthentication
In case of failure handling an Authentication frame from the AP MLD,
clear the MLD state only after the deauthentication is done. This allows
deauthentication process to use the AP MLD MAC address.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2024-04-21 11:55:53 +03:00
Ilan Peer
39fefeada6 SME: MLD: Deauthenticate when failing to parse ML element
If parsing the basic ML element in the Authenticate frame fails,
instead of only disassociating, completely deauthenticate so all
state machines would be in a consistent state.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2024-04-21 11:01:28 +03:00
Ilan Peer
6f3e7c5d3e wpa_supplicant: Do not roam to an associated link
When considering to roam to a different BSS and the connection
is an MLD connection, do not roam to a BSS which is already
included in the MLD connection.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2024-04-21 11:00:13 +03:00
Ilan Peer
0df2c72c54 tests: Wait after removing a BSS
When a BSS is removed, the flow continues without actually
waiting for the AP to be stopped. This is racy in flows that
actually expect the AP to be stopped, e.g., test_ap_bss_add_remove().

Try to mitigate such cases by adding a short sleep after the
AP is removed.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2024-04-21 10:53:39 +03:00
Jouni Malinen
2bbe4822a6 Clear connect_without_scan on network profile removal
wpa_s->connect_without_scan could have been left pointing to invalid
network when a network profile was removed. It seems to be possible for
this to happen in some hwsim test case scenarios under specific timing,
but the exact reason for this is not clear. In any case, this pointer
needs to be cleared.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-04-20 18:42:26 +03:00
Jouni Malinen
42517eb3b0 tests: Clear scan cache in ap_hs20_anqp_invalid_gas_response
This is needed to avoid unexpected behavior if a previously executed
test case has left a BSS entry with Interworking emabled into the case.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-04-20 18:31:11 +03:00
Jouni Malinen
b3ad54e460 Check whether to skip a BSS in RNR with a shared helper
The functions that determine the length of the RNR information and that
build the actual RNR need to use the same conditions for skipping BSSs.
Use a shared helper function for this to avoid having to maintain two
copies of the same implementation and the risking those getting out of
sync.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-20 18:31:11 +03:00
Aditya Kumar Singh
de1bfda64e Fix RNR building for co-location and MLO
RNR formation for co-location or MLO did not work as expected. Fix this.

For example, during co-location, if the BSS is also its ML partner
there is no need to include a separate TBTT for it.

Also, during co-location, if the BSS is not its partner but it is ML
capable, the TBTT length should be 16 bytes and it should include the
MLD Parameters for it in the RNR.

During co-location, for a given Neighbor AP (operating on a given
channel and op-class) if it has BSSs which are ML capable as well as
BSSs which are not, there should be two Neighbor AP Info present: one
indicating TBTT length as 13 bytes and one indicating TBTT info length
as 16 bytes.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Harshitha Prem
8d434bf65c AP MLD: Add link details in STATUS command
Include link ID and partner link details in the STATUS command output
for AP MLDs.

The details would be seen as below for an AP MLD interface:

$ hostapd_cli -i wlan0 status | grep link
num_links=1
link_id=0
link_addr=AA:BB:CC:DD:EE:FF

$ hostapd_cli -i wlan1 status | grep link
num_links=2
link_id=0
link_addr=AA:BB:CC:DD:EE:FF
partner_link[1]=AA:BB:CC:DD:EE:AA

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Co-developed-by: Manish Dharanenthiran <quic_mdharane@quicinc.com>
Signed-off-by: Manish Dharanenthiran <quic_mdharane@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Aditya Kumar Singh
b1e463374e AP MLD: Link-specific flushing of stations
Whenever a BSS was set up,hostapd flushed all stations via the flush()
driver operation which maps to NL80211_CMD_DEL_STATION in the nl80211
interface. However, in case of MLO, a station could have been connected
to other links by the time this link is coming up. Since link ID was not
passed to flush(), all those stations entries were also removed in the
driver which is wrong.

Include the link ID along with the command in AP MLD so that the driver
can use this link ID and flush only the stations that use the passed
link ID as one of their links.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Rameshkumar Sundaram
5e3c2b489c AP MLD: Run authenticator state machine for all links
This is needed for MLO group rekeying.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Rameshkumar Sundaram
12acda633b AP MLD: Support group rekeying for MLO
Group rekeying was not supported for ML stations when non-association
link initiates a group rekey. Support this by arming the group key rekey
timer on one of the affiliated links and whenever this timer fires,
rekey group keys on all the affiliated links.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Rameshkumar Sundaram
62a8f96e5b AP MLD: Calculate ML KDE length separately for each link
Calculate links specific MLO GTK/IGTK/BIGTK KDE lengths based on
corresponding cipher and key instead of taking length of one link and
multiplying it by no of associated links. This is needed since the group
ciphers might be different between the affiliated links.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Rameshkumar Sundaram
78adbf2c08 AP MLD: Mark GKeyDone completed for STAs in a helper function
This makes it easier to extend the design for MLO group rekeying.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Rameshkumar Sundaram
e5b49876a8 AP MLD: Debug print of MLO KDE lengths
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Rameshkumar Sundaram
84d2a36da0 AP MLD: Require same AKM and pairwise cipher for all links
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Co-developed-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Jouni Malinen
8891ebdc1d Use defined values for RSN PN length
Make the code more readable by using a define for the PN length to avoid
potential confusion of this 6 octet length with the MAC address length.
In addition, Use ETH_ALEN more consistently for the latter.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2024-04-20 18:31:11 +03:00
Rameshkumar Sundaram
3ea7cf11db AP MLD: Enhance authenticator state machine
Add required ML specific members in struct wpa_authenticator and struct
wpa_state_machine to maintain self and partner link information.

Maintain state machine object in all associated link stations and
destroy/remove references from the same whenever link stations are
getting removed.

Increase the wpa_group object reference count for all links in which ML
station is getting associated and release the same whenever link
stations are getting removed.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Aditya Kumar Singh
19fdcf511b AP MLD: Skip association link processing in ML info
All links were iterated over during processing ML info in Association
Request frame. However, the association link info will not be present in
the ML info and hence the following debug print is observed during ML
association (assoc link is 1):

MLD: No link match for link_id=1

Skip processing for the association link to avoid this.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00
Sriram R
4a1197acde AP MLD: Update all partner links' beacons
Whenever there is a beacon update for any one of the affiliated link,
all the other partner links' beacon should be refreshed.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
2024-04-20 18:31:11 +03:00