From 077c4039518a9115a9b0bf5d063c37cc72773c0f Mon Sep 17 00:00:00 2001 From: Bing Zhao Date: Tue, 26 Feb 2013 15:22:17 -0800 Subject: [PATCH] Add debugging to trace the loss of hidden ssid 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 Signed-off-by: Ashok Nagarajan Reviewed-on: https://gerrit.chromium.org/gerrit/44124 Reviewed-by: Darin Petkov Reviewed-by: mukesh agrawal --- drivers/net/wireless/mwifiex/scan.c | 7 +++++++ net/wireless/lib80211.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 0b51328b0986..4e6c0fae6c6a 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c @@ -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, diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c index a55c27b75ee5..d64ae563fca2 100644 --- a/net/wireless/lib80211.c +++ b/net/wireless/lib80211.c @@ -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; } -- 2.20.1