From patchwork Thu Mar 28 13:06:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1917340 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kKbcPdnB; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=YYWTj43M; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V53jk6GKgz1yWr for ; Fri, 29 Mar 2024 00:07:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cUHUhq3zheZDy8Kk4/dDXXH6+ZWIMIAI+ahfgtm7EPU=; b=kKbcPdnBozwF1j /Qs2GuzgLeOQGtCdZnKIzSmR81glfjzzR+XIav/cBpAQxifKIxlfI9KWnFE0fxpcaVd07AoXRwAyk xN6049tV4238YRD/bDc6c4H5NgcwZjNAt2yC4E6WT1i59/ZO9CPteIwKJQAmAkV6vc+D2dgirlgqM j9JW2sU1goyvNl+1VGl8o8YM73ogyzcvRMtFt/v3Bm6E6Fcpvbon+p+KePDnQoQsBlm1i1ueM9eaL phOk9kTWGYbL5XgPi5OUqkWgHpyOGqGpD/posA/NQ2iV+1IFzU5cAN8dX56mpc2PhT+TDkJqHk4ne jp6SNUvFNBt9lth5ZeNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rppTL-0000000E2cY-3p5u; Thu, 28 Mar 2024 13:07:11 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rppTF-0000000E2Y5-1GhX for hostap@lists.infradead.org; Thu, 28 Mar 2024 13:07:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=E1BswNdkAaN1VtitLOyBJoTfBzkhxDHCG1m6INxfNlg=; t=1711631223; x=1712840823; b=YYWTj43M4TIlvoSjSlq7fK4ENBUk/qyaXsQZjPoyP4dL3iL8UQorUsVdybSktet163KM0W5Dcsn AtpjL4wu46g/sPptd0cbVDrIMYzsMqq+nAe8xusfJsiOaYqJmo0olDuzL9zuZUS3o4Fk8r29RFF+U VRXRz7yX9GjQVOrTgnwEX85RnHk9dqQ7ayGxOwHEODDlzeDcjYcS0ESqC2FStYaSJixUTLnXREWH8 9Nf1Zskem8edNa3dDMOOhh0jkHjmzgIMSHC1OnAHbnl2bMEiy1XTLh8IfEZaS00uS9rXxBgWEgJiJ a19+kVa72wEEY45auuI4kW6UpqhyeaBN6fSQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rppTA-00000000zBF-1cG7; Thu, 28 Mar 2024 14:07:00 +0100 From: Johannes Berg To: hostap@lists.infradead.org Cc: Johannes Berg Subject: [PATCH 1/3] hostapd: add support for testing probe response elements Date: Thu, 28 Mar 2024 14:06:58 +0100 Message-ID: <20240328140657.c09d8b9b6542.I8fda4243e4210c203472f3d40953575428fbdd04@changeid> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240328_060705_431751_97E92A91 X-CRM114-Status: GOOD ( 16.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Johannes Berg Add support for additional (vendor) elements to be added to only probe response frames, for testing. Signed-off-by: Johannes Berg --- hostapd/config_file.c | 3 +++ hostapd/hostapd.conf | 8 ++++++++ src/ap/ap_config.c | 1 + src/ap/ap_config.h | 1 + src/ap/ap_drv_ops.c | 3 +++ [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg Add support for additional (vendor) elements to be added to only probe response frames, for testing. Signed-off-by: Johannes Berg --- hostapd/config_file.c | 3 +++ hostapd/hostapd.conf | 8 ++++++++ src/ap/ap_config.c | 1 + src/ap/ap_config.h | 1 + src/ap/ap_drv_ops.c | 3 +++ src/ap/beacon.c | 12 ++++++++++++ 6 files changed, 28 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index e9f0c5ca2344..843e31c6a367 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -4516,6 +4516,9 @@ static int hostapd_config_fill(struct hostapd_config *conf, bss->eapol_m3_no_encrypt = atoi(pos); } else if (os_strcmp(buf, "test_assoc_comeback_type") == 0) { bss->test_assoc_comeback_type = atoi(pos); + } else if (os_strcmp(buf, "presp_elements") == 0) { + if (parse_wpabuf_hex(line, buf, &bss->presp_elements, pos)) + return 1; #endif /* CONFIG_TESTING_OPTIONS */ #ifdef CONFIG_SAE } else if (os_strcmp(buf, "sae_password") == 0) { diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 727a87770a86..35e9ae4c629a 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -3216,6 +3216,14 @@ own_ip_addr=127.0.0.1 # attempt (wpa_pairwise_update_count). This will trigger a timeout on all # previous attempts and thus delays the frame. (testing only) #delay_eapol_tx=0 +# +# Additional elements for Probe Response frames. +# This parameter can be used to add additional element(s) to +# the end of the Probe Response frames. The format for these +# element(s) is a hexdump of the raw information elements (id+len+payload for +# one or more elements) +# These elements are added after the 'vendor_elements'. +#presp_elements= ##### Multiple BSSID support ################################################## # diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 1a18df61771d..e1910d42239b 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -967,6 +967,7 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf) wpabuf_free(conf->igtk_rsc_override); wpabuf_free(conf->eapol_m1_elements); wpabuf_free(conf->eapol_m3_elements); + wpabuf_free(conf->presp_elements); #endif /* CONFIG_TESTING_OPTIONS */ os_free(conf->no_probe_resp_if_seen_on); diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 754d553311d8..4cce662782f3 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -713,6 +713,7 @@ struct hostapd_bss_config { #ifdef CONFIG_IEEE80211BE u16 eht_oper_puncturing_override; #endif /* CONFIG_IEEE80211BE */ + struct wpabuf *presp_elements; #endif /* CONFIG_TESTING_OPTIONS */ #define MESH_ENABLED BIT(0) diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index 6d910aa5aafe..1b1a9dcffa00 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -208,6 +208,9 @@ int hostapd_build_ap_extra_ies(struct hostapd_data *hapd, add_buf(&beacon, hapd->conf->vendor_elements); add_buf(&proberesp, hapd->conf->vendor_elements); +#ifdef CONFIG_TESTING_OPTIONS + add_buf(&proberesp, hapd->conf->presp_elements); +#endif add_buf(&assocresp, hapd->conf->assocresp_elements); *beacon_ret = beacon; diff --git a/src/ap/beacon.c b/src/ap/beacon.c index e339c2002fab..6bf2693bea4e 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -649,6 +649,10 @@ static size_t hostapd_probe_resp_elems_len(struct hostapd_data *hapd, #endif /* CONFIG_FST */ if (hapd->conf->vendor_elements) buflen += wpabuf_len(hapd->conf->vendor_elements); +#ifdef CONFIG_TESTING_OPTIONS + if (hapd->conf->presp_elements) + buflen += wpabuf_len(hapd->conf->presp_elements); +#endif if (hapd->conf->vendor_vht) { buflen += 5 + 2 + sizeof(struct ieee80211_vht_capabilities) + 2 + sizeof(struct ieee80211_vht_operation); @@ -885,6 +889,14 @@ static u8 * hostapd_probe_resp_fill_elems(struct hostapd_data *hapd, pos += wpabuf_len(hapd->conf->vendor_elements); } +#ifdef CONFIG_TESTING_OPTIONS + if (hapd->conf->presp_elements) { + os_memcpy(pos, wpabuf_head(hapd->conf->presp_elements), + wpabuf_len(hapd->conf->presp_elements)); + pos += wpabuf_len(hapd->conf->presp_elements); + } +#endif + return pos; } From patchwork Thu Mar 28 13:06:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1917339 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=E6OJqnGm; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=rcaHju1F; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V53jk4v1Jz23sY for ; Fri, 29 Mar 2024 00:07:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+MwJHWVqde/KBAOMeQ5LBmW3oDwK8AAiH9vBIt6UuF4=; b=E6OJqnGmSgH8O2 Z7KOdrpJVVEyC3pvj6NnJhMikzGZ+wfws/iQhb4FJhTzCix4Fais0Lq9QQwmSZmyO0AoYmjy6MLqd 3lrXLPx5fhTi1TMrgutWFoKx6BKffbrbWuZE7OTKy5xSQwtFLtcD/yFKrDtYUtghr3JbIeeqnIWOc naDWEVaqnZVeIUK1eFFMBvEEH6mCExIdE333rKJbRPEmk9F7lGm9wYxLXagqZfpgv6cVdm6TX1KQ0 5JBNiD4xuvo3kZLCzQbNdun82MJEtLlCEGtzLkJjv1qNB/eRErZ8uNVNtvl5GQ/Xc39oVoQEgVl+E vehnc6Cipxzf6QtMY8Hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rppTJ-0000000E2bJ-0Skg; Thu, 28 Mar 2024 13:07:09 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rppTF-0000000E2Y2-1HvD for hostap@lists.infradead.org; Thu, 28 Mar 2024 13:07:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=05q5FKxGIAAYaqHhMm88cFExMaQFuvYFzmi8CV17m8E=; t=1711631223; x=1712840823; b=rcaHju1FVrDDMq/1IE/7+5WdH0yqel9y71jGMujCP9AaDhJ alqh1YD8HmS1YIZJpayLXG3LISfYQIcTT6ywx7/JICbbaRfJoYKNg8ZG8XeajWKdFXjcGTam8DrKx /Do6LwV5tGh7VVFnLGmBynFfL88RxzStu/7NxwCz1mkPkLEQnGiKTXQK8j5F5KwZ6B+mA6pRhHeQ7 u9luyHbZ9hhgxfTlmxLqpFyBF3wX9jBFh/hueeWwwT7e5SWEmitNgE/q3siVCU3RPD+BSJFB4xyOf IsIP5Sd0MpwBsHaaflCYcoyeAS9y7DOnTID06g3G4sJeSbro4ICyYWQpD7odKtig==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rppTB-00000000zBF-08aG; Thu, 28 Mar 2024 14:07:01 +0100 From: Johannes Berg To: hostap@lists.infradead.org Cc: Johannes Berg Subject: [PATCH 2/3] tests: add connecting-while-CSA tests Date: Thu, 28 Mar 2024 14:06:59 +0100 Message-ID: <20240328140657.16968637737e.I343be2981d629fb765485433459f24c7944da408@changeid> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240328140657.c09d8b9b6542.I8fda4243e4210c203472f3d40953575428fbdd04@changeid> References: <20240328140657.c09d8b9b6542.I8fda4243e4210c203472f3d40953575428fbdd04@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240328_060705_418721_D28D15E4 X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Johannes Berg 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 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg 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 --- tests/hwsim/test_ap_csa.py | 63 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/tests/hwsim/test_ap_csa.py b/tests/hwsim/test_ap_csa.py index c9ac73291a21..f05eaf1d7ecd 100644 --- a/tests/hwsim/test_ap_csa.py +++ b/tests/hwsim/test_ap_csa.py @@ -193,3 +193,66 @@ def test_ap_csa_disable(dev, apdev): ap.enable() dev[0].wait_disconnected() dev[0].wait_connected() + +def _assoc_while_csa(dev, apdev, freq_to, blocktx): + params = { + "ssid": "ap-csa", + "hw_mode": "a", + "country_code": "FI", + "channel": "36", + "ieee80211n": "0", + } + ap = hostapd.add_ap(apdev[0], params) + count = 100 if blocktx else 20 + delay = 1 + count / 10 + cmd = f"CHAN_SWITCH {count} {freq_to}" + if blocktx: + cmd += " blocktx" + ap.request(cmd) + + ev = ap.wait_event(["CTRL-EVENT-STARTED-CHANNEL-SWITCH"], timeout=10) + if ev is None: + raise Exception("Channel switch start event not seen") + if f"freq={freq_to}" not in ev: + raise Exception("Unexpected channel in CS started event") + try: + dev[0].connect("ap-csa", key_mgmt="NONE", scan_freq="5180", + wait_connect=False) + if blocktx or freq_to != 5180: + ev = dev[0].wait_event(["CTRL-EVENT-SSID-TEMP-DISABLED", + "CTRL-EVENT-CONNECTED"], timeout=9) + if not ev: # this is fine, at least we didn't connect + return + if not "CTRL-EVENT-SSID-TEMP-DISABLED" in ev: + raise Exception("Erroneously connected!") + if not 'auth_failures=1' in ev: + raise Exception(f'Should have auth failures in "{ev}"') + # wait for CSA to finish and connect then + time.sleep(delay) + dev[0].connect("ap-csa", key_mgmt="NONE", scan_freq=str(freq_to)) + else: + dev[0].wait_connected() + if freq_to != 5180: + wait_channel_switch(dev[0], freq_to) + finally: + dev[0].request("DISCONNECT") + clear_regdom(ap, dev) + +@long_duration_test +def test_assoc_while_csa_same_blocktx(dev, apdev): + "Check we don't associate while AP is doing quiet CSA (same channel)" + _assoc_while_csa(dev, apdev, 5180, True) + +def test_assoc_while_csa_same(dev, apdev): + "Check we _do_ associate while AP is doing CSA (same channel)" + _assoc_while_csa(dev, apdev, 5180, False) + +@long_duration_test +def test_assoc_while_csa_diff_blocktx(dev, apdev): + "Check we don't associate while AP is doing quiet CSA (different channel)" + _assoc_while_csa(dev, apdev, 5200, True) + +@long_duration_test +def test_assoc_while_csa_diff(dev, apdev): + "Check we don't associate while AP is doing CSA (different channel)" + _assoc_while_csa(dev, apdev, 5200, False) From patchwork Thu Mar 28 13:07:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1917338 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Q8CVBlTg; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=RoeSLvYG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V53jk1MlVz1yYk for ; Fri, 29 Mar 2024 00:07:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=u9g/3pPSOYaUqA5Y+R/7iTBRjTtu+y1gznprGmBMIrM=; b=Q8CVBlTgL24lW9 L0aPT+EnoEsNqD0hjIvHW84ziF8yhkIYcHFm5WmAloZu8vNUUmy/zyJAfren9egtZqpV1rE6gUd0C iMF0ZkV31TPbg4Clq/nHzJPt8g+CBSXwFIXAbmeOtqiHbKK+ZEpsjX6Nk0tj+PvMqtEpU+fdVOlV0 SYHP1QjH0/uLOxEDCbjt1+Zs8PyvqYT+zX04LBW/ZixCtz63OBdEmJj86BZeqDB3m6ziABJpTgJGw OnQRqtsFO5logBCNRXrmeR2rhp0W3QTzl2wq6gInOhHn0iwSQ55sgLzO8yViVVXJgLs6b5IgYjnCb /6kXIYo8YM2I6aWLNEQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rppTK-0000000E2bw-2GaF; Thu, 28 Mar 2024 13:07:10 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rppTF-0000000E2YY-1HX2 for hostap@lists.infradead.org; Thu, 28 Mar 2024 13:07:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=37dB2TzzAV4icOmOcf5h19+tCDlGKquZeRNW2f7FTcE=; t=1711631223; x=1712840823; b=RoeSLvYG0oVcFPuQKfl7zVo0jxnYan9g+gW2lEtcjU4z+w5 Dd/D03yDM1DimQF99h+etiELlKVz0BIGzDfx0kLMY03idJ91VxGFs9qEcd632pcbW67hiezPAaW67 RakpZReCXcWeZ6z6uKisHkUW4AVA7039Sq1IwpRSED+Z2IDFJ03QCF5bl2WrJ74p3w37GsDYLj2KH nplmBuSCcRvLcvZe6JAQAapISZcnnnMzwPONW7YvE+vnYPkionqvGxXFcuRAb3y0gvgomoIs7QZ7b YZ2VFI2hroK5F2Uo8VMsyfLs0o1RPYc+EiHTHHLY80D8Gsm77RBPUZ3MagfVVYbg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rppTB-00000000zBF-2nYR; Thu, 28 Mar 2024 14:07:01 +0100 From: Johannes Berg To: hostap@lists.infradead.org Cc: Johannes Berg Subject: [PATCH 3/3] tests: add test with stuck ECSA in probe response Date: Thu, 28 Mar 2024 14:07:00 +0100 Message-ID: <20240328140657.718acf749bd7.Ia51d8220c59936191138d7aab0366c749ed37fdb@changeid> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240328140657.c09d8b9b6542.I8fda4243e4210c203472f3d40953575428fbdd04@changeid> References: <20240328140657.c09d8b9b6542.I8fda4243e4210c203472f3d40953575428fbdd04@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240328_060705_435052_2BDCD379 X-CRM114-Status: UNSURE ( 8.41 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Johannes Berg 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 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg 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 --- tests/hwsim/test_ap_csa.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/hwsim/test_ap_csa.py b/tests/hwsim/test_ap_csa.py index f05eaf1d7ecd..a8a4ef61a040 100644 --- a/tests/hwsim/test_ap_csa.py +++ b/tests/hwsim/test_ap_csa.py @@ -256,3 +256,17 @@ def test_assoc_while_csa_diff_blocktx(dev, apdev): def test_assoc_while_csa_diff(dev, apdev): "Check we don't associate while AP is doing CSA (different channel)" _assoc_while_csa(dev, apdev, 5200, False) + +def test_ap_stuck_ecsa(dev, apdev): + """Test behaving like an Asus RT-AC53, firmware 3.0.0.4.380_10760-g21a5898, + which has stuck ECSA element in the probe response.""" + try: + ap = connect(dev[0], apdev, scan_freq=None, + hw_mode='a', channel='36', + country_code='FI', + presp_elements="3c0401732409") + ap.wait_sta() + hwsim_utils.test_connectivity(dev[0], ap) + finally: + dev[0].request("DISCONNECT") + clear_regdom(ap, dev)