summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ieee80211/ieee80211_rx.c19
-rw-r--r--net/ieee80211/ieee80211_wx.c7
-rw-r--r--net/wireless/lib80211.c9
3 files changed, 21 insertions, 14 deletions
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index f15f82e..d19c8de 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -1124,6 +1124,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
*info_element, u16 length,
struct ieee80211_network *network)
{
+ DECLARE_SSID_BUF(ssid);
u8 i;
#ifdef CONFIG_IEEE80211_DEBUG
char rates_str[64];
@@ -1155,7 +1156,8 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
IW_ESSID_MAX_SIZE - network->ssid_len);
IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n",
- escape_ssid(network->ssid),
+ print_ssid(ssid, network->ssid,
+ network->ssid_len),
network->ssid_len);
break;
@@ -1401,6 +1403,8 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
struct ieee80211_network *network,
struct ieee80211_rx_stats *stats)
{
+ DECLARE_SSID_BUF(ssid);
+
network->qos_data.active = 0;
network->qos_data.supported = 0;
network->qos_data.param_count = 0;
@@ -1449,7 +1453,7 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
if (network->mode == 0) {
IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' "
"network.\n",
- escape_ssid(network->ssid,
+ print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid);
return 1;
@@ -1563,10 +1567,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device
struct ieee80211_info_element *info_element = beacon->info_element;
#endif
unsigned long flags;
+ DECLARE_SSID_BUF(ssid);
IEEE80211_DEBUG_SCAN("'%s' (%pM"
"): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
- escape_ssid(info_element->data, info_element->len),
+ print_ssid(ssid, info_element->data, info_element->len),
beacon->header.addr3,
(beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0',
(beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0',
@@ -1587,7 +1592,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
if (ieee80211_network_init(ieee, beacon, &network, stats)) {
IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n",
- escape_ssid(info_element->data,
+ print_ssid(ssid, info_element->data,
info_element->len),
beacon->header.addr3,
is_beacon(beacon->header.frame_ctl) ?
@@ -1625,7 +1630,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
target = oldest;
IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from "
"network list.\n",
- escape_ssid(target->ssid,
+ print_ssid(ssid, target->ssid,
target->ssid_len),
target->bssid);
ieee80211_network_reset(target);
@@ -1638,7 +1643,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
#ifdef CONFIG_IEEE80211_DEBUG
IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n",
- escape_ssid(network.ssid,
+ print_ssid(ssid, network.ssid,
network.ssid_len),
network.bssid,
is_beacon(beacon->header.frame_ctl) ?
@@ -1649,7 +1654,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
list_add_tail(&target->list, &ieee->network_list);
} else {
IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n",
- escape_ssid(target->ssid,
+ print_ssid(ssid, target->ssid,
target->ssid_len),
target->bssid,
is_beacon(beacon->header.frame_ctl) ?
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index 3025140..29eb416 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -34,6 +34,7 @@
#include <linux/module.h>
#include <linux/jiffies.h>
+#include <net/lib80211.h>
#include <net/ieee80211.h>
#include <linux/wireless.h>
@@ -258,6 +259,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
char *ev = extra;
char *stop = ev + wrqu->data.length;
int i = 0;
+ DECLARE_SSID_BUF(ssid);
IEEE80211_DEBUG_WX("Getting scan\n");
@@ -277,7 +279,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
else
IEEE80211_DEBUG_SCAN("Not showing network '%s ("
"%pM)' due to age (%dms).\n",
- escape_ssid(network->ssid,
+ print_ssid(ssid, network->ssid,
network->ssid_len),
network->bssid,
jiffies_to_msecs(jiffies -
@@ -307,6 +309,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
int i, key, key_provided, len;
struct ieee80211_crypt_data **crypt;
int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv;
+ DECLARE_SSID_BUF(ssid);
IEEE80211_DEBUG_WX("SET_ENCODE\n");
@@ -402,7 +405,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
memset(sec.keys[key] + erq->length, 0,
len - erq->length);
IEEE80211_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n",
- key, escape_ssid(sec.keys[key], len),
+ key, print_ssid(ssid, sec.keys[key], len),
erq->length, len);
sec.key_sizes[key] = len;
if (*crypt)
diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c
index b8e34d3..e71f7d0 100644
--- a/net/wireless/lib80211.c
+++ b/net/wireless/lib80211.c
@@ -19,11 +19,10 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR("John W. Linville <linville@tuxdriver.com>");
MODULE_LICENSE("GPL");
-const char *escape_ssid(const char *ssid, u8 ssid_len)
+const char *print_ssid(char *buf, const char *ssid, u8 ssid_len)
{
- static char escaped[IEEE80211_MAX_SSID_LEN * 4 + 1];
const char *s = ssid;
- char *d = escaped;
+ char *d = buf;
ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN);
while (ssid_len--) {
@@ -48,9 +47,9 @@ const char *escape_ssid(const char *ssid, u8 ssid_len)
s++;
}
*d = '\0';
- return escaped;
+ return buf;
}
-EXPORT_SYMBOL(escape_ssid);
+EXPORT_SYMBOL(print_ssid);
static int __init ieee80211_init(void)
{
OpenPOWER on IntegriCloud