[PATCH 1/2] Do not use aborted scan results for new operations

Chaitanya Tata chaitanya.mgit at gmail.com
Sun Jun 28 12:52:05 PDT 2026


From: Frederik Van Bogaert <frederik.vanbogaert at mind.be>

When a scan is aborted, the reported scan results are incomplete and
must not be used to drive network selection or to start other
operations. Processing such results, e.g., while trying to connect to a
network that is not present, ends up in the "no suitable network found"
handling that schedules another scan. If scans keep getting aborted,
the supplicant ends up continuously processing aborted scan results
without making any progress.

Skip network selection and the other operations that are triggered from
the scan results when the scan was aborted, while still delivering the
scan result notifications and completing the scan radio work as before.

Signed-off-by: Frederik Van Bogaert <frederik.vanbogaert at mind.be>
[chaitanya.tata: move the check after the scan result notifications so
that an aborted scan still reports CTRL-EVENT-SCAN-RESULTS]
Signed-off-by: Chaitanya Tata <chaitanya.tata at nordicsemi.no>
---
 wpa_supplicant/events.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 5faeddfbe..e738c5225 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2642,6 +2642,12 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
 		return 0;
 	}
 
+	if (data && data->scan_info.aborted) {
+		wpa_dbg(wpa_s, MSG_DEBUG,
+			"Scan was aborted - do not use the incomplete scan results to trigger new operations");
+		goto scan_work_done;
+	}
+
 	if (sme_proc_obss_scan(wpa_s) > 0)
 		goto scan_work_done;
 
-- 
2.43.0




More information about the Hostap mailing list