From 2818e9ca903e52bb9a41921ec664d3a2e8572688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20M=C3=BCller?= Date: Thu, 18 Jun 2020 16:39:12 +0200 Subject: [PATCH] wpa_supplicant: Do not retry scan if operation is not supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using NetworkManager to set up an access point, there seems to be a race condition which can lead to a new log message every second. The following message appears in AP mode: CTRL-EVENT-SCAN-FAILED ret=-95 retry=1 Normally, this log message only appears once. But then (and only then) the race is triggered and they appear every second, the following log messages are also present: Reject scan trigger since one is already pending Failed to initiate AP scan This patch just disables the retry for requests where the operation is not supported anyway. Signed-off-by: Georg Müller --- wpa_supplicant/scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 7415eae9f..b9e4162c8 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -237,6 +237,10 @@ static void wpas_trigger_scan_cb(struct wpa_radio_work *work, int deinit) if (wpa_s->disconnected) retry = 0; + /* do not retry if operation is not supported */ + if (ret == -EOPNOTSUPP) + retry = 0; + wpa_supplicant_notify_scanning(wpa_s, 0); wpas_notify_scan_done(wpa_s, 0); if (wpa_s->wpa_state == WPA_SCANNING)