[PATCH] wpa_supplicant: do not retry scan if operation is not supported

Georg Müller <[email protected]> Thu, 18 Jun 2020 16:39:12 +0200
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
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 <[email protected]>
---
 wpa_supplicant/scan.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index b47573094..9f18b5143 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)
--
2.26.2


_______________________________________________
Hostap mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/hostap