[PATCH] tests: test reassociation with swapped assoc link

Benjamin Berg benjamin at sipsolutions.net
Fri Jul 18 05:15:08 PDT 2025


From: Benjamin Berg <benjamin.berg at intel.com>

Add a test that reassociates to the same AP MLD but with the association
link changed.

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

---

Hi all,

so, this one seems to really confuse hostapd. It correctly notices that
the same station is returning, but does not seem to realise that the
link/address is different.

Not sure how to fix that, but maybe someone else has an idea?

Thanks,
Benjamin

Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
 tests/hwsim/test_eht.py | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/tests/hwsim/test_eht.py b/tests/hwsim/test_eht.py
index e17dfd488f..6446c5a014 100644
--- a/tests/hwsim/test_eht.py
+++ b/tests/hwsim/test_eht.py
@@ -2358,6 +2358,43 @@ def test_eht_mld_cohosted_connectivity(dev, apdev, params):
 
         stop_mld_devs(hapds, params['prefix'])
 
+def test_eht_mld_reassoc_two_links_change_tx(dev, apdev):
+    """EHT MLD with two links. Reassociate with swapped association link"""
+
+    with HWSimRadio(use_mlo=True) as (hapd0_radio, hapd0_iface), \
+        HWSimRadio(use_mlo=True) as (wpas_radio, wpas_iface):
+
+        wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+        wpas.interface_add(wpas_iface)
+
+        ssid = "mld_ap_owe_two_link"
+        params = eht_mld_ap_wpa2_params(ssid, key_mgmt="OWE", mfp="2")
+        params['bssid'] = '00:11:22:33:44:01'
+        hapd0 = eht_mld_enable_ap(hapd0_iface, 0, params)
+
+        params['channel'] = '6'
+        params['bssid'] = '00:11:22:33:44:02'
+        hapd1 = eht_mld_enable_ap(hapd0_iface, 1, params)
+
+        wpas.set("mld_connect_bssid_pref", "00:11:22:33:44:01")
+        wpas.connect(ssid, scan_freq="2412 2437", key_mgmt="OWE", ieee80211w="2")
+        eht_verify_status(wpas, hapd0, 2412, 20, is_ht=True, mld=True, valid_links=3,
+                           active_links=3)
+        eht_verify_wifi_version(wpas)
+        traffic_test(wpas, hapd0)
+
+        wpas.set("mld_connect_bssid_pref", "00:11:22:33:44:02")
+
+        if "OK" not in wpas.request("REASSOCIATE"):
+            raise Exception("Failed to request reassociation")
+
+        wpas.wait_connected(timeout=7)
+
+        eht_verify_status(wpas, hapd0, 2412, 20, is_ht=True, mld=True, valid_links=3,
+                          active_links=3)
+        eht_verify_wifi_version(wpas)
+        traffic_test(wpas, hapd0)
+
 def test_eht_mlo_color_change(dev, apdev):
     """AP MLD and Color Change Announcement"""
     with HWSimRadio(use_mlo=True) as (hapd_radio, hapd_iface), \
-- 
2.50.0




More information about the Hostap mailing list