aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2008-09-30 20:59:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:50 -0400
commit9387b7caf3049168fc97a8a9111af8fe2143af18 (patch)
tree6a19e5477d6a6badf19788536a9d3e1913ae48e1 /net
parent2819f8ad6da1e24b5dd94a221978e61f2a9c972a (diff)
wireless: use individual buffers for printing ssid values
Also change escape_ssid to print_ssid to match print_mac semantics. Signed-off-by: John W. Linville <linville@tuxdriver.com>
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 f15f82e7bbfd..d19c8de6ef25 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
1124 *info_element, u16 length, 1124 *info_element, u16 length,
1125 struct ieee80211_network *network) 1125 struct ieee80211_network *network)
1126{ 1126{
1127 DECLARE_SSID_BUF(ssid);
1127 u8 i; 1128 u8 i;
1128#ifdef CONFIG_IEEE80211_DEBUG 1129#ifdef CONFIG_IEEE80211_DEBUG
1129 char rates_str[64]; 1130 char rates_str[64];
@@ -1155,7 +1156,8 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1155 IW_ESSID_MAX_SIZE - network->ssid_len); 1156 IW_ESSID_MAX_SIZE - network->ssid_len);
1156 1157
1157 IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n", 1158 IEEE80211_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n",
1158 escape_ssid(network->ssid), 1159 print_ssid(ssid, network->ssid,
1160 network->ssid_len),
1159 network->ssid_len); 1161 network->ssid_len);
1160 break; 1162 break;
1161 1163
@@ -1401,6 +1403,8 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1401 struct ieee80211_network *network, 1403 struct ieee80211_network *network,
1402 struct ieee80211_rx_stats *stats) 1404 struct ieee80211_rx_stats *stats)
1403{ 1405{
1406 DECLARE_SSID_BUF(ssid);
1407
1404 network->qos_data.active = 0; 1408 network->qos_data.active = 0;
1405 network->qos_data.supported = 0; 1409 network->qos_data.supported = 0;
1406 network->qos_data.param_count = 0; 1410 network->qos_data.param_count = 0;
@@ -1449,7 +1453,7 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1449 if (network->mode == 0) { 1453 if (network->mode == 0) {
1450 IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' " 1454 IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' "
1451 "network.\n", 1455 "network.\n",
1452 escape_ssid(network->ssid, 1456 print_ssid(ssid, network->ssid,
1453 network->ssid_len), 1457 network->ssid_len),
1454 network->bssid); 1458 network->bssid);
1455 return 1; 1459 return 1;
@@ -1563,10 +1567,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1563 struct ieee80211_info_element *info_element = beacon->info_element; 1567 struct ieee80211_info_element *info_element = beacon->info_element;
1564#endif 1568#endif
1565 unsigned long flags; 1569 unsigned long flags;
1570 DECLARE_SSID_BUF(ssid);
1566 1571
1567 IEEE80211_DEBUG_SCAN("'%s' (%pM" 1572 IEEE80211_DEBUG_SCAN("'%s' (%pM"
1568 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", 1573 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
1569 escape_ssid(info_element->data, info_element->len), 1574 print_ssid(ssid, info_element->data, info_element->len),
1570 beacon->header.addr3, 1575 beacon->header.addr3,
1571 (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0', 1576 (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0',
1572 (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0', 1577 (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0',
@@ -1587,7 +1592,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1587 1592
1588 if (ieee80211_network_init(ieee, beacon, &network, stats)) { 1593 if (ieee80211_network_init(ieee, beacon, &network, stats)) {
1589 IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n", 1594 IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n",
1590 escape_ssid(info_element->data, 1595 print_ssid(ssid, info_element->data,
1591 info_element->len), 1596 info_element->len),
1592 beacon->header.addr3, 1597 beacon->header.addr3,
1593 is_beacon(beacon->header.frame_ctl) ? 1598 is_beacon(beacon->header.frame_ctl) ?
@@ -1625,7 +1630,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1625 target = oldest; 1630 target = oldest;
1626 IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from " 1631 IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from "
1627 "network list.\n", 1632 "network list.\n",
1628 escape_ssid(target->ssid, 1633 print_ssid(ssid, target->ssid,
1629 target->ssid_len), 1634 target->ssid_len),
1630 target->bssid); 1635 target->bssid);
1631 ieee80211_network_reset(target); 1636 ieee80211_network_reset(target);
@@ -1638,7 +1643,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1638 1643
1639#ifdef CONFIG_IEEE80211_DEBUG 1644#ifdef CONFIG_IEEE80211_DEBUG
1640 IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n", 1645 IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n",
1641 escape_ssid(network.ssid, 1646 print_ssid(ssid, network.ssid,
1642 network.ssid_len), 1647 network.ssid_len),
1643 network.bssid, 1648 network.bssid,
1644 is_beacon(beacon->header.frame_ctl) ? 1649 is_beacon(beacon->header.frame_ctl) ?
@@ -1649,7 +1654,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1649 list_add_tail(&target->list, &ieee->network_list); 1654 list_add_tail(&target->list, &ieee->network_list);
1650 } else { 1655 } else {
1651 IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n", 1656 IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n",
1652 escape_ssid(target->ssid, 1657 print_ssid(ssid, target->ssid,
1653 target->ssid_len), 1658 target->ssid_len),
1654 target->bssid, 1659 target->bssid,
1655 is_beacon(beacon->header.frame_ctl) ? 1660 is_beacon(beacon->header.frame_ctl) ?
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index 3025140ae721..29eb41695a82 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -34,6 +34,7 @@
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/jiffies.h> 35#include <linux/jiffies.h>
36 36
37#include <net/lib80211.h>
37#include <net/ieee80211.h> 38#include <net/ieee80211.h>
38#include <linux/wireless.h> 39#include <linux/wireless.h>
39 40
@@ -258,6 +259,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
258 char *ev = extra; 259 char *ev = extra;
259 char *stop = ev + wrqu->data.length; 260 char *stop = ev + wrqu->data.length;
260 int i = 0; 261 int i = 0;
262 DECLARE_SSID_BUF(ssid);
261 263
262 IEEE80211_DEBUG_WX("Getting scan\n"); 264 IEEE80211_DEBUG_WX("Getting scan\n");
263 265
@@ -277,7 +279,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
277 else 279 else
278 IEEE80211_DEBUG_SCAN("Not showing network '%s (" 280 IEEE80211_DEBUG_SCAN("Not showing network '%s ("
279 "%pM)' due to age (%dms).\n", 281 "%pM)' due to age (%dms).\n",
280 escape_ssid(network->ssid, 282 print_ssid(ssid, network->ssid,
281 network->ssid_len), 283 network->ssid_len),
282 network->bssid, 284 network->bssid,
283 jiffies_to_msecs(jiffies - 285 jiffies_to_msecs(jiffies -
@@ -307,6 +309,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
307 int i, key, key_provided, len; 309 int i, key, key_provided, len;
308 struct ieee80211_crypt_data **crypt; 310 struct ieee80211_crypt_data **crypt;
309 int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv; 311 int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv;
312 DECLARE_SSID_BUF(ssid);
310 313
311 IEEE80211_DEBUG_WX("SET_ENCODE\n"); 314 IEEE80211_DEBUG_WX("SET_ENCODE\n");
312 315
@@ -402,7 +405,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
402 memset(sec.keys[key] + erq->length, 0, 405 memset(sec.keys[key] + erq->length, 0,
403 len - erq->length); 406 len - erq->length);
404 IEEE80211_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n", 407 IEEE80211_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n",
405 key, escape_ssid(sec.keys[key], len), 408 key, print_ssid(ssid, sec.keys[key], len),
406 erq->length, len); 409 erq->length, len);
407 sec.key_sizes[key] = len; 410 sec.key_sizes[key] = len;
408 if (*crypt) 411 if (*crypt)
diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c
index b8e34d31e757..e71f7d085621 100644
--- a/net/wireless/lib80211.c
+++ b/net/wireless/lib80211.c
@@ -19,11 +19,10 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
19MODULE_AUTHOR("John W. Linville <linville@tuxdriver.com>"); 19MODULE_AUTHOR("John W. Linville <linville@tuxdriver.com>");
20MODULE_LICENSE("GPL"); 20MODULE_LICENSE("GPL");
21 21
22const char *escape_ssid(const char *ssid, u8 ssid_len) 22const char *print_ssid(char *buf, const char *ssid, u8 ssid_len)
23{ 23{
24 static char escaped[IEEE80211_MAX_SSID_LEN * 4 + 1];
25 const char *s = ssid; 24 const char *s = ssid;
26 char *d = escaped; 25 char *d = buf;
27 26
28 ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN); 27 ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN);
29 while (ssid_len--) { 28 while (ssid_len--) {
@@ -48,9 +47,9 @@ const char *escape_ssid(const char *ssid, u8 ssid_len)
48 s++; 47 s++;
49 } 48 }
50 *d = '\0'; 49 *d = '\0';
51 return escaped; 50 return buf;
52} 51}
53EXPORT_SYMBOL(escape_ssid); 52EXPORT_SYMBOL(print_ssid);
54 53
55static int __init ieee80211_init(void) 54static int __init ieee80211_init(void)
56{ 55{