]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Ignore scan results in wpa_supplicant AP mode
authorJouni Malinen <jouni.malinen@atheros.com>
Sun, 18 Jul 2010 03:32:25 +0000 (20:32 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 18 Jul 2010 03:32:25 +0000 (20:32 -0700)
This is needed to avoid trying to reassociate based on new scan
results when using wpa_supplicant to control AP mode. This could
happen if something external triggered the driver to run a scan.

wpa_supplicant/events.c

index 819c55710152168f5f2a7100b1b3d19be88fcae6..a36c467b07a8b2498ba90faff1df75a5b4d212bb 100644 (file)
@@ -889,6 +889,12 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
        struct wpa_bss *selected;
        struct wpa_ssid *ssid = NULL;
        struct wpa_scan_results *scan_res;
+       int ap = 0;
+
+#ifdef CONFIG_AP
+       if (wpa_s->ap_iface)
+               ap = 1;
+#endif /* CONFIG_AP */
 
        wpa_supplicant_notify_scanning(wpa_s, 0);
 
@@ -896,7 +902,7 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
                                                   data ? &data->scan_info :
                                                   NULL, 1);
        if (scan_res == NULL) {
-               if (wpa_s->conf->ap_scan == 2)
+               if (wpa_s->conf->ap_scan == 2 || ap)
                        return;
                wpa_printf(MSG_DEBUG, "Failed to get scan results - try "
                           "scanning again");
@@ -911,6 +917,12 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
                return;
        }
 
+       if (ap) {
+               wpa_printf(MSG_DEBUG, "Ignore scan results in AP mode");
+               wpa_scan_results_free(scan_res);
+               return;
+       }
+
        /*
         * Don't post the results if this was the initial cached
         * and there were no results.