From d4534bde9c2fb5bb4de9321b5bdb565c6f74133e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 24 Sep 2012 01:04:00 +0300 Subject: [PATCH] Add debug print for no-enabled-networks case If there are any disabled networks, show a debug print with the count of those networks when no enabled networks are found. This can be helpful in trying to figure out why scans are being skipped. Signed-hostap: Jouni Malinen --- wpa_supplicant/scan.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index c892f7d1f..c01867119 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -83,15 +83,21 @@ static int wpas_wps_in_use(struct wpa_supplicant *wpa_s, int wpa_supplicant_enabled_networks(struct wpa_supplicant *wpa_s) { struct wpa_ssid *ssid = wpa_s->conf->ssid; - int count = 0; + int count = 0, disabled = 0; while (ssid) { if (!wpas_network_disabled(wpa_s, ssid)) count++; + else + disabled++; ssid = ssid->next; } if (wpa_s->conf->cred && wpa_s->conf->interworking && wpa_s->conf->auto_interworking) count++; + if (count == 0 && disabled > 0) { + wpa_dbg(wpa_s, MSG_DEBUG, "No enabled networks (%d disabled " + "networks)", disabled); + } return count; }