]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add scanned frequencies/SSIDs into debug log
authorJouni Malinen <j@w1.fi>
Thu, 26 Dec 2013 14:39:39 +0000 (16:39 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 26 Dec 2013 16:27:48 +0000 (18:27 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

src/drivers/driver_nl80211.c

index 8547e78d4a14db94fa9aa105ffaa53a762a0be7b..e47291cc58a7d53e79289a17a504c5ec3ee0e203 100644 (file)
@@ -2037,21 +2037,36 @@ static void send_scan_event(struct wpa_driver_nl80211_data *drv, int aborted,
                                &info->ssids[info->num_ssids];
                        s->ssid = nla_data(nl);
                        s->ssid_len = nla_len(nl);
+                       wpa_printf(MSG_DEBUG, "nl80211: Scan probed for SSID '%s'",
+                                  wpa_ssid_txt(s->ssid, s->ssid_len));
                        info->num_ssids++;
                        if (info->num_ssids == WPAS_MAX_SCAN_SSIDS)
                                break;
                }
        }
        if (tb[NL80211_ATTR_SCAN_FREQUENCIES]) {
+               char msg[200], *pos, *end;
+               int res;
+
+               pos = msg;
+               end = pos + sizeof(msg);
+               *pos = '\0';
+
                nla_for_each_nested(nl, tb[NL80211_ATTR_SCAN_FREQUENCIES], rem)
                {
                        freqs[num_freqs] = nla_get_u32(nl);
+                       res = os_snprintf(pos, end - pos, " %d",
+                                         freqs[num_freqs]);
+                       if (res > 0 && end - pos > res)
+                               pos += res;
                        num_freqs++;
                        if (num_freqs == MAX_REPORT_FREQS - 1)
                                break;
                }
                info->freqs = freqs;
                info->num_freqs = num_freqs;
+               wpa_printf(MSG_DEBUG, "nl80211: Scan included frequencies:%s",
+                          msg);
        }
        wpa_supplicant_event(drv->ctx, EVENT_SCAN_RESULTS, &event);
 }