From 5bc0cdb7212cb53b82f0ac705bdef6088e24a71f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 17 Jul 2010 20:32:25 -0700 Subject: [PATCH] Ignore scan results in wpa_supplicant AP mode 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 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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.