Add debugging to trace the loss of hidden ssid
authorBing Zhao <bzhao@marvell.com>
Tue, 26 Feb 2013 23:22:17 +0000 (15:22 -0800)
committerChromeBot <chrome-bot@google.com>
Wed, 27 Feb 2013 23:19:45 +0000 (15:19 -0800)
This patch will help to trace if hidden ssid is lost in firmware or driver.
SSID and mac address should be anonymized.

BUG=chrome-os-partner:17989
TEST=trigger a scan and grep for "inform bss" in dmesg/messages. Submit a
feedback report and verify if SSIDs and mac addresses are anonymized. Verified
with the feedback report 718249759.

Change-Id: I0df02a9f8eb1898f6f3af2438c614031bb44f329
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Ashok Nagarajan <asnagarajan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44124
Reviewed-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
drivers/net/wireless/mwifiex/scan.c
net/wireless/lib80211.c

index 0b51328..4e6c0fa 100644 (file)
@@ -1708,6 +1708,13 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
                        chan = ieee80211_get_channel(priv->wdev->wiphy, freq);
 
                        if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
+                               DECLARE_SSID_BUF(ssid_buf);
+
+                               wiphy_info(priv->wdev->wiphy,
+                                          "inform bss: %pM [SSID=%s]\n", bssid,
+                                          print_ssid(ssid_buf, ie_buf + 2,
+                                                     *(ie_buf + 1)));
+
                                bss = cfg80211_inform_bss(priv->wdev->wiphy,
                                              chan, bssid, timestamp,
                                              cap_info_bitmap, beacon_period,
index a55c27b..d64ae56 100644 (file)
@@ -54,7 +54,9 @@ const char *print_ssid(char *buf, const char *ssid, u8 ssid_len)
        ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN);
        while (ssid_len--) {
                if (isprint(*s)) {
-                       *d++ = *s++;
+                       if (*s != '[' && *s != ']')
+                               *d++ = *s;
+                       s++;
                        continue;
                }