diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 819c55710..a36c467b0 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -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.