]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add debug print for no-enabled-networks case
authorJouni Malinen <j@w1.fi>
Sun, 23 Sep 2012 22:04:00 +0000 (01:04 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 23 Sep 2012 22:04:00 +0000 (01:04 +0300)
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>

wpa_supplicant/scan.c

index c892f7d1f377123d80d7db7b55b3bbfec3fd77ef..c01867119b8d0958818e83b6ead6e12ee6e85a88 100644 (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)
 {
        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;
 }