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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2012-09-24 01:04:00 +03:00
parent b470b2bf37
commit d4534bde9c

View File

@ -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) int wpa_supplicant_enabled_networks(struct wpa_supplicant *wpa_s)
{ {
struct wpa_ssid *ssid = wpa_s->conf->ssid; struct wpa_ssid *ssid = wpa_s->conf->ssid;
int count = 0; int count = 0, disabled = 0;
while (ssid) { while (ssid) {
if (!wpas_network_disabled(wpa_s, ssid)) if (!wpas_network_disabled(wpa_s, ssid))
count++; count++;
else
disabled++;
ssid = ssid->next; ssid = ssid->next;
} }
if (wpa_s->conf->cred && wpa_s->conf->interworking && if (wpa_s->conf->cred && wpa_s->conf->interworking &&
wpa_s->conf->auto_interworking) wpa_s->conf->auto_interworking)
count++; count++;
if (count == 0 && disabled > 0) {
wpa_dbg(wpa_s, MSG_DEBUG, "No enabled networks (%d disabled "
"networks)", disabled);
}
return count; return count;
} }