From patchwork Thu Sep 19 10:19:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Berg X-Patchwork-Id: 1987326 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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 4X8WlQ5nBHz1y27 for ; Thu, 19 Sep 2024 20:21:37 +1000 (AEST) 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=W83mucSCm6xCdXI+1W1LNpkEbpcMgIIck1K/MqZMl6A=; b=GQkfclwkbXAr2s PRL5K1mS4sCnvMtt0yDAPIGaajmPjflzDmlGJiqcZc0N1E45Cjp+k7ZXuBORpyd5i7UVdfvy9qAeB qoUtNy6k9nYm5pMj6Yx14ivg3It5Otf/OXidsX2eY1F6lgjU189U+KHix3Als6Lgi1suFFg45AHLf 0e4MeQiytJiH4MTq0YpiI9xNInMELHFAItWx79UrVzoZ90a5CkN6xp7JXi9NDZJcMNxWvCwKPyKhy bC9WzFUJsWQzLW3izM856K2eOAhZGO5NYaST+CLmK1SEhNQqYJZM6IMcppMC03x7W4wiqHQ0I4mMs YoWERQQiK8ezsjj/4s7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srEHU-0000000A1wv-30eI; Thu, 19 Sep 2024 10:21:00 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srEHP-0000000A1v2-2cCN for hostap@lists.infradead.org; Thu, 19 Sep 2024 10:20:57 +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=JyHgUJza7UcAKmw47xStnuAXkKMbcQtbYRsQA61GjFg=; t=1726741254; x=1727950854; b=rdLn664EnX02NBSWvvwSvuB+lRa4gqimCK+pL5qQoUEspRI1wunSGjNngV7273POIogQ9A4oV1L 7Hc29WgbeRLBAdsmBU6a89voVtB2L05E33DGZYxAPf6jWb6BXMa7TuMHuPCumHHJeXY+oDiDFKy2W nPCGJh5tTeFrIzT+XptqVPxHpsN+WqQzzjvrnitM/809DwhXzCV8S6lHHy4RJtHPwhkfc3i1WsgD4 4D0OIwGHuR0OIIr7ev6phn7vM7sBDZTQaF8zP++OgV38RQw4hqC6UHqvfVQbf6m918k4B4FrS9S3S oKpMbBr3OfPY/fkdIncVMNNIBu9yxpQ2vyGQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1srEHL-00000003p6L-0hGt; Thu, 19 Sep 2024 12:20:51 +0200 From: Benjamin Berg To: hostap@lists.infradead.org Cc: Benjamin Berg Subject: [PATCH v3 1/3] WNM: Move driver MBO transition rejection into wnm_is_bss_excluded Date: Thu, 19 Sep 2024 12:19:15 +0200 Message-ID: <20240919101917.214290-1-benjamin@sipsolutions.net> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240919_032056_003659_1C2E4F60 X-CRM114-Status: GOOD ( 33.30 ) X-Spam-Score: -2.1 (--) 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: Benjamin Berg Change the logic a bit to not directly use the result of the wpa_drv_get_bss_trans_status call and instead use the same selection logic as usual but taking into account the driver rejections. Content analysis details: (-2.1 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_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: Benjamin Berg Change the logic a bit to not directly use the result of the wpa_drv_get_bss_trans_status call and instead use the same selection logic as usual but taking into account the driver rejections. This changes the logic in minor ways. The main change is that this aligns the ordering of BSSs to be identical in all cases. More precisely, we'll select the best BSS as found by find_better_target. Beyond that, it also means that in the case of an non-abridged BTM request we'll also consider candidates that were found through the scan and not in the neighbor report. In this case, the driver will not have a chance to reject them. Signed-off-by: Benjamin Berg --- v2: - Fix code when CONFIG_MBO is disabled - Add tests to verify the behaviour Signed-off-by: Benjamin Berg --- src/drivers/driver_nl80211.c | 49 +++++++++++++ src/utils/os_unix.c | 2 +- tests/hwsim/test_wnm.py | 55 ++++++++++++++ wpa_supplicant/wnm_sta.c | 137 +++++++++++++++++------------------ wpa_supplicant/wnm_sta.h | 2 +- 5 files changed, 172 insertions(+), 73 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 1356d325d5..e4465c6a4f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -13965,6 +13965,52 @@ static int nl80211_do_acs(void *priv, struct drv_acs_params *params) } +#if defined(CONFIG_MBO) && defined(WPA_TRACE_BFD) && defined(CONFIG_TESTING_OPTIONS) +static struct wpa_bss_candidate_info * +nl80211_get_bss_transition_status(void *priv, struct wpa_bss_trans_info *params) +{ + struct wpa_bss_candidate_info *info; + int i; + + /* This only exists for testing purposes, disable unless requested */ + if (!TEST_FAIL_TAG("simulate")) + return NULL; + + info = os_zalloc(sizeof(*info)); + if (!info) + return NULL; + + info->candidates = os_calloc(params->n_candidates, + sizeof(*info->candidates)); + if (!info->candidates) { + os_free(info); + return NULL; + } + + info->num = params->n_candidates; + for (i = 0; i < params->n_candidates; i++) { + char bssid_str[ETH_ALEN * 3]; + os_memcpy(info->candidates[i].bssid, + ¶ms->bssid[i * ETH_ALEN], ETH_ALEN); + + os_snprintf(bssid_str, sizeof(bssid_str), MACSTR, + MAC2STR(info->candidates[i].bssid)); + + if (TEST_FAIL_TAG(bssid_str)) { + info->candidates[i].is_accept = 0; + info->candidates[i].reject_reason = + MBO_TRANSITION_REJECT_REASON_FRAME_LOSS; + } else { + info->candidates[i].is_accept = 1; + info->candidates[i].reject_reason = 0; + } + } + + return info; +} +#endif /* defined(CONFIG_MBO) && defined(WPA_TRACE_BFD) && defined(CONFIG_TESTING_OPTIONS) */ + + static int nl80211_write_to_file(const char *name, unsigned int val) { int fd, len; @@ -14612,6 +14658,9 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { .nan_cancel_subscribe = nl80211_nan_cancel_subscribe, #endif /* CONFIG_NAN_USD */ #endif /* CONFIG_DRIVER_NL80211_QCA */ +#if defined(CONFIG_MBO) && defined(WPA_TRACE_BFD) && defined(CONFIG_TESTING_OPTIONS) + .get_bss_transition_status = nl80211_get_bss_transition_status, +#endif /* defined(CONFIG_MBO) && defined(WPA_TRACE_BFD) && defined(CONFIG_TESTING_OPTIONS) */ .do_acs = nl80211_do_acs, .configure_data_frame_filters = nl80211_configure_data_frame_filters, .get_ext_capab = nl80211_get_ext_capab, diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index 679f3a0dcc..cabfd87c0e 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -543,7 +543,7 @@ void * os_memdup(const void *src, size_t len) struct wpa_trace_test_fail { unsigned int fail_after; char pattern[256]; -} wpa_trace_test_fail[5][2]; +} wpa_trace_test_fail[5][4]; int testing_test_fail(const char *tag, bool is_alloc) { diff --git a/tests/hwsim/test_wnm.py b/tests/hwsim/test_wnm.py index bf4243a46a..cdb04f324d 100644 --- a/tests/hwsim/test_wnm.py +++ b/tests/hwsim/test_wnm.py @@ -1024,6 +1024,61 @@ def test_wnm_bss_tm(dev, apdev): if ev is not None: raise Exception("Unexpected scan started") + # The following two tests excercise the MBO target querying to the driver + dev[0].flush_scan_cache() + logger.info("BTM request with candidate list and all are valid, roams because MBO is enabled and driver rejects current") + with fail_test(dev[0], 1, "simulate;nl80211_get_bss_transition_status", + 1, apdev[0]['bssid'] + ";nl80211_get_bss_transition_status", + # Second time post-scan + 1, "simulate;nl80211_get_bss_transition_status", + 1, apdev[0]['bssid'] + ";nl80211_get_bss_transition_status"): + if "OK" not in hapd.request("BSS_TM_REQ " + addr + " pref=1 abridged=1 mbo=3:0:1 valid_int=255 neighbor=" + apdev[0]['bssid'] + ",0x0000,81,1,7,0301ff neighbor=" + apdev[1]['bssid'] + ",0x0000,115,36,7,0301ff"): + raise Exception("BSS_TM_REQ command failed") + ev = hapd.wait_event(['BSS-TM-RESP'], timeout=10) + if ev is None: + raise Exception("No BSS Transition Management Response") + if "status_code=0" not in ev: + raise Exception("BSS transition request was not accepted: " + ev) + if "target_bssid=" + apdev[1]['bssid'] not in ev: + raise Exception("Unexpected target BSS: " + ev) + # This scans only one frequency + scan_ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=0) + if scan_ev is None: + raise Exception("Expected scan started") + dev[0].wait_connected(timeout=15, error="No reassociation seen") + if apdev[1]['bssid'] not in ev: + raise Exception("Unexpected reassociation target: " + ev) + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=0.1) + if ev is not None: + raise Exception("Unexpected scan started") + + dev[0].flush_scan_cache() + logger.info("BTM request with candidate list forcing other AP throug disassoc imminent, driver does MBO reject, but still roams") + with fail_test(dev[0], 1, "simulate;nl80211_get_bss_transition_status", + 1, apdev[0]['bssid'] + ";nl80211_get_bss_transition_status", + # And a second time post-scan + 1, "simulate;nl80211_get_bss_transition_status", + 1, apdev[0]['bssid'] + ";nl80211_get_bss_transition_status"): + if "OK" not in hapd2.request("BSS_TM_REQ " + addr + " disassoc_imminent=1 pref=1 abridged=1 mbo=3:5:1 valid_int=255 neighbor=" + apdev[0]['bssid'] + ",0x0000,81,1,7,0301ff"): + raise Exception("BSS_TM_REQ command failed") + ev = hapd2.wait_event(['BSS-TM-RESP'], timeout=10) + if ev is None: + raise Exception("No BSS Transition Management Response") + if "status_code=0" not in ev: + raise Exception("BSS transition request was not accepted: " + ev) + if "target_bssid=" + apdev[0]['bssid'] not in ev: + raise Exception("Unexpected target BSS: " + ev) + # This scans only one frequency + scan_ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=0) + if scan_ev is None: + raise Exception("Expected scan started") + dev[0].wait_connected(timeout=15, error="No reassociation seen") + if apdev[0]['bssid'] not in ev: + raise Exception("Unexpected reassociation target: " + ev) + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=0.1) + if ev is not None: + raise Exception("Unexpected scan started") + finally: clear_regdom_state(dev, hapd, hapd2) diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index 662f6089e6..3638cd5433 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -614,38 +614,37 @@ static void wnm_parse_neighbor_report(struct wpa_supplicant *wpa_s, } -static void wnm_clear_acceptable(struct wpa_supplicant *wpa_s) -{ - unsigned int i; - - for (i = 0; i < wpa_s->wnm_num_neighbor_report; i++) - wpa_s->wnm_neighbor_report_elements[i].acceptable = 0; -} - -#ifdef CONFIG_MBO -static struct wpa_bss * -get_mbo_transition_candidate(struct wpa_supplicant *wpa_s, +static void +fetch_drv_mbo_candidate_info(struct wpa_supplicant *wpa_s, enum mbo_transition_reject_reason *reason) { - struct wpa_bss *target = NULL; +#ifdef CONFIG_MBO struct wpa_bss_trans_info params; struct wpa_bss_candidate_info *info = NULL; - struct neighbor_report *nei = wpa_s->wnm_neighbor_report_elements; - u8 *first_candidate_bssid = NULL, *pos; + struct neighbor_report *nei; + u8 *pos; unsigned int i; + if (!wpa_s->wnm_mbo_trans_reason_present) + return; + params.mbo_transition_reason = wpa_s->wnm_mbo_transition_reason; params.n_candidates = 0; params.bssid = os_calloc(wpa_s->wnm_num_neighbor_report, ETH_ALEN); if (!params.bssid) - return NULL; + return; pos = params.bssid; - for (i = 0; i < wpa_s->wnm_num_neighbor_report; nei++, i++) { - if (nei->is_first) - first_candidate_bssid = nei->bssid; - if (!nei->acceptable) + for (i = 0; i < wpa_s->wnm_num_neighbor_report; i++) { + nei = &wpa_s->wnm_neighbor_report_elements[i]; + + nei->drv_mbo_reject = 0; + + if (nei->preference_present && nei->preference == 0) continue; + + /* Should we query BSSIDs that we reject for other reasons? */ + os_memcpy(pos, nei->bssid, ETH_ALEN); pos += ETH_ALEN; params.n_candidates++; @@ -655,64 +654,37 @@ get_mbo_transition_candidate(struct wpa_supplicant *wpa_s, goto end; info = wpa_drv_get_bss_trans_status(wpa_s, ¶ms); - if (!info) { - /* If failed to get candidate BSS transition status from driver, - * get the first acceptable candidate from wpa_supplicant. - */ - target = wpa_bss_get_bssid(wpa_s, params.bssid); + if (!info) goto end; - } - /* Get the first acceptable candidate from driver */ for (i = 0; i < info->num; i++) { - if (info->candidates[i].is_accept) { - target = wpa_bss_get_bssid(wpa_s, - info->candidates[i].bssid); - goto end; - } - } + int j; - /* If Disassociation Imminent is set and driver rejects all the - * candidate select first acceptable candidate which has - * rssi > disassoc_imminent_rssi_threshold - */ - if (wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT) { - for (i = 0; i < info->num; i++) { - target = wpa_bss_get_bssid(wpa_s, - info->candidates[i].bssid); - if (target && - (target->level < - wpa_s->conf->disassoc_imminent_rssi_threshold)) + for (j = 0; j < wpa_s->wnm_num_neighbor_report; nei++, j++) { + nei = &wpa_s->wnm_neighbor_report_elements[j]; + + if (!ether_addr_equal(info->candidates[i].bssid, + nei->bssid)) continue; - goto end; - } - } - /* While sending BTM reject use reason code of the first candidate - * received in BTM request frame - */ - if (reason) { - for (i = 0; i < info->num; i++) { - if (first_candidate_bssid && - ether_addr_equal(first_candidate_bssid, - info->candidates[i].bssid)) { + nei->drv_mbo_reject = !info->candidates[i].is_accept; + + /* Use the reject reason from "first" candidate */ + if (nei->is_first && nei->drv_mbo_reject) *reason = info->candidates[i].reject_reason; - break; - } + + break; } } - target = NULL; - end: os_free(params.bssid); if (info) { os_free(info->candidates); os_free(info); } - return target; -} #endif /* CONFIG_MBO */ +} static struct wpa_bss * find_better_target(struct wpa_bss *a, @@ -754,8 +726,6 @@ compare_scan_neighbor_results(struct wpa_supplicant *wpa_s, wpa_printf(MSG_DEBUG, "WNM: Current BSS " MACSTR " RSSI %d", MAC2STR(wpa_s->bssid), bss->level); - wnm_clear_acceptable(wpa_s); - for (i = 0; i < wpa_s->wnm_num_neighbor_report; i++) { struct neighbor_report *nei; @@ -795,21 +765,12 @@ compare_scan_neighbor_results(struct wpa_supplicant *wpa_s, continue; } - nei->acceptable = 1; - best_target = find_better_target(target, best_target); if (target == bss) bss_in_list = bss; } -#ifdef CONFIG_MBO - if (wpa_s->wnm_mbo_trans_reason_present) - target = get_mbo_transition_candidate(wpa_s, reason); - else - target = best_target; -#else /* CONFIG_MBO */ target = best_target; -#endif /* CONFIG_MBO */ if (!target) return NULL; @@ -1178,8 +1139,39 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check) wpa_s->wnm_transition_scan = false; + /* Fetch MBO transition candidate rejection information from driver */ + fetch_drv_mbo_candidate_info(wpa_s, &reason); + /* Compare the Neighbor Report and scan results */ bss = compare_scan_neighbor_results(wpa_s, &reason); +#ifdef CONFIG_MBO + if (!bss && wpa_s->wnm_mbo_trans_reason_present && + wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT) { + int i; + + /* + * We didn't find any candidate, the driver had a say about + * which targets to reject and disassociation is immiment. + * + * We should still try to roam, so retry after ignoring the + * driver reject for any BSS that has an RSSI better than + * disassoc_imminent_rssi_threshold. + */ + for (i = 0; i < wpa_s->wnm_num_neighbor_report; i++) { + struct neighbor_report *nei; + + nei = &wpa_s->wnm_neighbor_report_elements[i]; + + bss = wpa_bss_get_bssid(wpa_s, nei->bssid); + + if (bss->level > + wpa_s->conf->disassoc_imminent_rssi_threshold) + nei->drv_mbo_reject = 0; + } + + bss = compare_scan_neighbor_results(wpa_s, &reason); + } +#endif /* CONFIG_MBO */ /* * If this is a pre-scan check, returning 0 will trigger a scan and @@ -2118,6 +2110,9 @@ bool wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) if (nei->preference_present && nei->preference == 0) return true; + if (nei->drv_mbo_reject) + return true; + break; } diff --git a/wpa_supplicant/wnm_sta.h b/wpa_supplicant/wnm_sta.h index 235a838fab..5994027a44 100644 --- a/wpa_supplicant/wnm_sta.h +++ b/wpa_supplicant/wnm_sta.h @@ -44,9 +44,9 @@ struct neighbor_report { unsigned int rm_capab_present:1; unsigned int bearing_present:1; unsigned int bss_term_present:1; - unsigned int acceptable:1; #ifdef CONFIG_MBO unsigned int is_first:1; + unsigned int drv_mbo_reject:1; #endif /* CONFIG_MBO */ struct measurement_pilot *meas_pilot; struct multiple_bssid *mul_bssid; From patchwork Thu Sep 19 10:19:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Berg X-Patchwork-Id: 1987325 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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 4X8WlQ5qklz1y2q for ; Thu, 19 Sep 2024 20:21:36 +1000 (AEST) 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=CMxJ/gJo1owjB2ZfNhP4spdFB5TxAg9P5+xxtTQZaAg=; b=TuLOiRQhM+F75g B4ksmDIp4r2lLZjPSD/qz8EA3QRiGQpuGczIP50lBI+n8beeg4Esh8gmAK5k3QVhanZvwD3weWqse HJUra0bM7ylttbGls6M3t8YU0nI3Hrx6/lWel74qN2Bx/p/G6RP47cvHf4TvlfWcFf6NNQHARgKtD BqDeOfbrywNF7Ki3nMG8HXJByYBtNUV9VnkmF/+HVxSvxz4GRRwyfloj7kopMAbPvhOP6fbn0+tup dYeJxgBmbem5cnXRE+bF1QtQCwtmAzfJ3EI9u21bxlczw8mg18jlQ+Yc9VDgM0L/aECiQynEE7hVb t0KVNBjDaIk7MsEAdihA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srEHT-0000000A1wL-2w4X; Thu, 19 Sep 2024 10:20:59 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srEHP-0000000A1v7-2c8c for hostap@lists.infradead.org; Thu, 19 Sep 2024 10:20:56 +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=nXP1UMoQY1ugwO5+MFGANlgPE5GObDnV4Yv26RSFK9I=; t=1726741255; x=1727950855; b=CMalUvFIzxfI30k5QQC+CLoLhc8dBH5MLtlY6SVqPyVeggr loPRZChs3V/bpM0X8m5HfE4T4HgnfUh+2pR/mpZlEyJh954ptFb4eyrT8eiTrGwzysnqKBx3EKG3r pqwa6EyfNxesY5++emesDFYqf+IRb/nk/fCk+0mGzj+RpwycGDU4boGLoC4vi4uVchrU8sEyN5eMW ONFiJVJDzGUAniN6OrZiu+ZA8llwBQfZOkhTWjSEZyqQPzgQYp/ba9yyanz/A2ThLKTYl5oPIKFfi 6VHrvPUL0O2gnU5gDKgBhZscW4P/d1iKlC9WJyBd8ndq3Q06bR18Zc81OWfE5sKg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1srEHN-00000003p6L-0kYq; Thu, 19 Sep 2024 12:20:53 +0200 From: Benjamin Berg To: hostap@lists.infradead.org Cc: Benjamin Berg Subject: [PATCH v3 2/3] WNM: Fix pre-scan rejection heuristic for BTM handling Date: Thu, 19 Sep 2024 12:19:16 +0200 Message-ID: <20240919101917.214290-2-benjamin@sipsolutions.net> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240919101917.214290-1-benjamin@sipsolutions.net> References: <20240919101917.214290-1-benjamin@sipsolutions.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240919_032055_689729_5B371DFA X-CRM114-Status: GOOD ( 15.78 ) X-Spam-Score: -2.1 (--) 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: Benjamin Berg The idea was to only accept the cached scan results if the new target is reasonably good. To avoid having to write a custom quality logic, a call to wpa_supplicant_need_to_roam_within_ess was used. Ho [...] Content analysis details: (-2.1 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_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: Benjamin Berg The idea was to only accept the cached scan results if the new target is reasonably good. To avoid having to write a custom quality logic, a call to wpa_supplicant_need_to_roam_within_ess was used. However, the intention was to swap the parameters and check whether we would want to roam from the new BSS back to the current one. Fix the heuristic to match the comment. To do that, we need to add a parameter to not poll the current signal level as that would result in comparing the current BSS with itself within the function. Signed-off-by: Benjamin Berg --- wpa_supplicant/events.c | 7 ++++--- wpa_supplicant/wnm_sta.c | 4 ++-- wpa_supplicant/wpa_supplicant_i.h | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 90e1c7b9fb..668068167f 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -2163,7 +2163,8 @@ static int wpas_evaluate_band_score(int frequency) int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s, struct wpa_bss *current_bss, - struct wpa_bss *selected) + struct wpa_bss *selected, + bool poll_current) { int min_diff, diff; int cur_band_score, sel_band_score; @@ -2218,7 +2219,7 @@ int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s, * scan results may be a bit old, since we can very quickly get fresh * information about our currently associated AP. */ - if (wpa_drv_signal_poll(wpa_s, &si) == 0 && + if (poll_current && wpa_drv_signal_poll(wpa_s, &si) == 0 && (si.data.avg_beacon_signal || si.data.avg_signal)) { /* * Normalize avg_signal to the RSSI over 20 MHz, as the @@ -2391,7 +2392,7 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s, #ifndef CONFIG_NO_ROAMING return wpa_supplicant_need_to_roam_within_ess(wpa_s, current_bss, - selected); + selected, true); #else /* CONFIG_NO_ROAMING */ return 0; #endif /* CONFIG_NO_ROAMING */ diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index 3638cd5433..dcef8053ee 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -1195,9 +1195,9 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check) #ifndef CONFIG_NO_ROAMING if (wpa_s->current_bss && bss != wpa_s->current_bss && - wpa_supplicant_need_to_roam_within_ess(wpa_s, + wpa_supplicant_need_to_roam_within_ess(wpa_s, bss, wpa_s->current_bss, - bss)) + false)) return 0; #endif /* CONFIG_NO_ROAMING */ } diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 3f704ecfd9..7c51cdb20e 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -1868,7 +1868,8 @@ void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s, struct channel_list_changed *info); int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s, struct wpa_bss *current_bss, - struct wpa_bss *seleceted); + struct wpa_bss *selected, + bool poll_current); void wpas_reset_mlo_info(struct wpa_supplicant *wpa_s); /* eap_register.c */ From patchwork Thu Sep 19 10:19:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Berg X-Patchwork-Id: 1987327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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 4X8WlR0F8Jz1y2t for ; Thu, 19 Sep 2024 20:21:37 +1000 (AEST) 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=9+cNMB4+dUhvGXjkXreEC5DoT8qfj2W4DlCxclaWAD0=; b=G7dZ+e20IMg4Gh l/zfWUC0e9qE861uecQqWcUeRcpoDDMzphvJe8tUyg2+1RsYNX8Lnd5CxswvA17y+TQf4CuaMPAQI 4zJMLOmTcLuMmWUBmP3Tz5YxBbQMKuC428op189XHzRIPrlZ3O/sKqBPB/W61a8UxVdKzg/KYvDkI Hc4+07hY/AyCKsP7ZCN1U3LxUzHQtcO0lvyCJbVpOCi8OVJ2SbEertva1R4gbNdSLFyWWlhN4P7Mv qXSG5DvRTOkMFH1dTZaH/XSVryd2Jg+ci0WMnvitYF07bkSUwFtYwGepBj7SFUwCpUydu6NrL28JX GcwXWjvxhA/WwqCpbjMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srEHV-0000000A1x7-34A8; Thu, 19 Sep 2024 10:21:01 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srEHR-0000000A1vg-2C7J for hostap@lists.infradead.org; Thu, 19 Sep 2024 10:20:59 +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=xDPh+2jY5jUk4XDwrc7ZmNJbPyaxw/kVY508tDehuVA=; t=1726741257; x=1727950857; b=jtf8N0snSy09r5GbCdoSrP7bM6M3pfPToNqDe+lkYfE12k8 q+luDl+Jzphos3Fg63tFQVkQ1jB6dCFYPKh8vBxvRBu9kxqdQ0nc0ohURNW3NqN4oRJWTApXp1ZOC Gr6DCnWpRiH31VSMBzRXK57cdp/x3eI79bt+bOkACMHBjViPUnGVCt2qPAGh6xvJQv3zH01kDYLLz qxRudBjljQbElYvo9GuFOzhAh5tK0Eq5BFFdnuWBY/WHjhpdsME9U/7HmE+fiphmic0hFIZs4MRiI vRs8G/XI0v1MeBniBZ20Ac27om93ZcFEHPmPwkVpyo7WkCVH8eUc3XGeRW/pG+xA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1srEHO-00000003p6L-3l3v; Thu, 19 Sep 2024 12:20:55 +0200 From: Benjamin Berg To: hostap@lists.infradead.org Cc: Benjamin Berg Subject: [PATCH v3 3/3] WNM: Use standard BSS selection and enable abridged bit handling Date: Thu, 19 Sep 2024 12:19:17 +0200 Message-ID: <20240919101917.214290-3-benjamin@sipsolutions.net> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240919101917.214290-1-benjamin@sipsolutions.net> References: <20240919101917.214290-1-benjamin@sipsolutions.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240919_032057_761911_EE5DE71E X-CRM114-Status: GOOD ( 26.21 ) X-Spam-Score: -2.1 (--) 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: Benjamin Berg Most of the logic to reject BSSs during transition has been moved into wnm_is_bss_excluded. In addition to this, since commit 67bf89f55442 ("WNM: Choose the best available BSS, not just the first one" [...] Content analysis details: (-2.1 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_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: Benjamin Berg Most of the logic to reject BSSs during transition has been moved into wnm_is_bss_excluded. In addition to this, since commit 67bf89f55442 ("WNM: Choose the best available BSS, not just the first one") we will simply choose the BSS with the best throughput. Overall, this matches the behaviour that the supplicant will use anyway in wpa_supplicant_select_bss. The only bigger difference is that using this will check all known BSSs instead of only the ones in the candidate list. This means that with this change the abridged bit is handled according to spec. There are some subtle changes to the logic. Once is, that candidates with a very low signal level are not explicitly dropped anymore. However, that code pre-dates the logic to prefer the best BSS and should not be relevant anymore. Another small adjustment is to change the custom logic to avoid roaming when it is not needed to use wpa_supplicant_need_to_roam_within_ess. Signed-off-by: Benjamin Berg --- v3: Apply normal roaming rules, to fix the issue found by Ben Greear Signed-off-by: Benjamin Berg --- wpa_supplicant/events.c | 2 +- wpa_supplicant/wnm_sta.c | 137 +++++------------------------- wpa_supplicant/wpa_supplicant_i.h | 5 ++ 3 files changed, 26 insertions(+), 118 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 668068167f..8e43db3e41 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1733,7 +1733,7 @@ struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s, } -static struct wpa_bss * +struct wpa_bss * wpa_supplicant_select_bss(struct wpa_supplicant *wpa_s, struct wpa_ssid *group, struct wpa_ssid **selected_ssid, diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index dcef8053ee..0ee47c2b4b 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -687,117 +687,6 @@ end: } -static struct wpa_bss * find_better_target(struct wpa_bss *a, - struct wpa_bss *b) -{ - if (!a) - return b; - if (!b) - return a; - - if (a->est_throughput > b->est_throughput) { - wpa_printf(MSG_DEBUG, "WNM: A is better: " MACSTR - " est-tput: %d B: " MACSTR " est-tput: %d", - MAC2STR(a->bssid), a->est_throughput, - MAC2STR(b->bssid), b->est_throughput); - return a; - } - - wpa_printf(MSG_DEBUG, "WNM: B is better, A: " MACSTR - " est-tput: %d B: " MACSTR " est-tput: %d", - MAC2STR(a->bssid), a->est_throughput, - MAC2STR(b->bssid), b->est_throughput); - return b; -} - -static struct wpa_bss * -compare_scan_neighbor_results(struct wpa_supplicant *wpa_s, - enum mbo_transition_reject_reason *reason) -{ - u8 i; - struct wpa_bss *bss = wpa_s->current_bss; - struct wpa_bss *target; - struct wpa_bss *best_target = NULL; - struct wpa_bss *bss_in_list = NULL; - - if (!bss) - return NULL; - - wpa_printf(MSG_DEBUG, "WNM: Current BSS " MACSTR " RSSI %d", - MAC2STR(wpa_s->bssid), bss->level); - - for (i = 0; i < wpa_s->wnm_num_neighbor_report; i++) { - struct neighbor_report *nei; - - nei = &wpa_s->wnm_neighbor_report_elements[i]; - - target = wpa_bss_get_bssid(wpa_s, nei->bssid); - if (!target) { - wpa_printf(MSG_DEBUG, "Candidate BSS " MACSTR - " (pref %d) not found in scan results", - MAC2STR(nei->bssid), - nei->preference_present ? nei->preference : - -1); - continue; - } - - /* - * TODO: Could consider allowing transition to another ESS if - * PMF was enabled for the association. - */ - if (!wpa_scan_res_match(wpa_s, 0, target, wpa_s->current_ssid, - 1, 0)) { - wpa_printf(MSG_DEBUG, "Candidate BSS " MACSTR - " (pref %d) does not match the current network profile", - MAC2STR(nei->bssid), - nei->preference_present ? nei->preference : - -1); - continue; - } - - if (target->level < bss->level && target->level < -80) { - wpa_printf(MSG_DEBUG, "Candidate BSS " MACSTR - " (pref %d) does not have sufficient signal level (%d)", - MAC2STR(nei->bssid), - nei->preference_present ? nei->preference : - -1, - target->level); - continue; - } - - best_target = find_better_target(target, best_target); - if (target == bss) - bss_in_list = bss; - } - - target = best_target; - - if (!target) - return NULL; - - wpa_printf(MSG_DEBUG, - "WNM: Found an acceptable preferred transition candidate BSS " - MACSTR " (RSSI %d, tput: %d bss-tput: %d)", - MAC2STR(target->bssid), target->level, - target->est_throughput, bss->est_throughput); - - if (!bss_in_list) - return target; - - if ((!target->est_throughput && !bss_in_list->est_throughput) || - (target->est_throughput > bss_in_list->est_throughput && - target->est_throughput - bss_in_list->est_throughput > - bss_in_list->est_throughput >> 4)) { - /* It is more than 100/16 percent better, so switch. */ - return target; - } - - wpa_printf(MSG_DEBUG, - "WNM: Stay with our current BSS, not enough change in estimated throughput to switch"); - return bss_in_list; -} - - static int wpa_bss_ies_eq(struct wpa_bss *a, struct wpa_bss *b, u8 eid) { const u8 *ie_a, *ie_b; @@ -1115,11 +1004,12 @@ static void wnm_bss_tm_connect(struct wpa_supplicant *wpa_s, int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check) { - struct wpa_bss *bss; + struct wpa_bss *bss, *current_bss = wpa_s->current_bss; struct wpa_ssid *ssid = wpa_s->current_ssid; enum bss_trans_mgmt_status_code status = WNM_BSS_TM_REJECT_UNSPECIFIED; enum mbo_transition_reject_reason reason = MBO_TRANSITION_REJECT_REASON_UNSPECIFIED; + struct wpa_ssid *selected_ssid = NULL; if (!wpa_s->wnm_dialog_token) return 0; @@ -1143,7 +1033,7 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check) fetch_drv_mbo_candidate_info(wpa_s, &reason); /* Compare the Neighbor Report and scan results */ - bss = compare_scan_neighbor_results(wpa_s, &reason); + bss = wpa_supplicant_select_bss(wpa_s, ssid, &selected_ssid, 1); #ifdef CONFIG_MBO if (!bss && wpa_s->wnm_mbo_trans_reason_present && wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT) { @@ -1169,7 +1059,7 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check) nei->drv_mbo_reject = 0; } - bss = compare_scan_neighbor_results(wpa_s, &reason); + bss = wpa_supplicant_select_bss(wpa_s, ssid, &selected_ssid, 1); } #endif /* CONFIG_MBO */ @@ -1194,20 +1084,33 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check) return 0; #ifndef CONFIG_NO_ROAMING - if (wpa_s->current_bss && bss != wpa_s->current_bss && + if (current_bss && bss != current_bss && wpa_supplicant_need_to_roam_within_ess(wpa_s, bss, - wpa_s->current_bss, - false)) + current_bss, false)) return 0; #endif /* CONFIG_NO_ROAMING */ } + /* Apply normal roaming rules if we can stay with the current BSS */ + if (current_bss && bss != current_bss && + wpa_scan_res_match(wpa_s, 0, current_bss, wpa_s->current_ssid, + 1, 0) && + !wpa_supplicant_need_to_roam_within_ess(wpa_s, current_bss, bss, + true)) + bss = current_bss; + if (!bss) { wpa_printf(MSG_DEBUG, "WNM: No BSS transition candidate match found"); status = WNM_BSS_TM_REJECT_NO_SUITABLE_CANDIDATES; goto send_bss_resp_fail; } + wpa_printf(MSG_DEBUG, + "WNM: Found an acceptable preferred transition candidate BSS " + MACSTR " (RSSI %d, tput: %d bss-tput: %d)", + MAC2STR(bss->bssid), bss->level, bss->est_throughput, + current_bss ? current_bss->est_throughput : -1); + /* Associate to the network */ wnm_bss_tm_connect(wpa_s, bss, ssid, 1); return 1; diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 7c51cdb20e..0bd4fcdedd 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -1965,6 +1965,11 @@ struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s, struct wpa_ssid *group, int only_first_ssid, int debug_print); +struct wpa_bss * wpa_supplicant_select_bss(struct wpa_supplicant *wpa_s, + struct wpa_ssid *group, + struct wpa_ssid **selected_ssid, + int only_first_ssid); + int wpas_ctrl_iface_get_pref_freq_list_override(struct wpa_supplicant *wpa_s, enum wpa_driver_if_type if_type, unsigned int *num,