]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix success check for triggering 6 GHz scan
authorMatthew Wang <matthewmwang@chromium.org>
Tue, 4 Jun 2024 21:02:16 +0000 (21:02 +0000)
committerJouni Malinen <j@w1.fi>
Sat, 3 Aug 2024 09:17:10 +0000 (12:17 +0300)
wpas_trigger_6ghz_scan() returns 1 on success and 0 on failure to
trigger the scan. Checking the return value to be less than zero is not
correct. This was supposed to check for success, i.e., greater than
zero.

Fixes: 42add3c27ba0 ("Scan 6 GHz channels after change to 6 GHz-allowed regdom")
Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
wpa_supplicant/events.c

index 7b39813f384b03cb87eae4313026cf0870876715..530a13edd7c52b8c6cf0cae7695a71280bb3c7ce 100644 (file)
@@ -2721,7 +2721,7 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
                                wpa_supplicant_rsn_preauth_scan_results(wpa_s);
                } else if (own_request) {
                        if (wpa_s->support_6ghz && trigger_6ghz_scan && data &&
-                           wpas_trigger_6ghz_scan(wpa_s, data) < 0)
+                           wpas_trigger_6ghz_scan(wpa_s, data) > 0)
                                return 1;
 
                        /*