diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/net-sysfs.c | 12 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 18 | ||||
-rw-r--r-- | net/wireless/sme.c | 5 | ||||
-rw-r--r-- | net/wireless/wext-sme.c | 8 | ||||
-rw-r--r-- | net/wireless/wext.c | 11 |
5 files changed, 26 insertions, 28 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 7d4c57523b09..821d30918cfc 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <net/sock.h> | 16 | #include <net/sock.h> |
17 | #include <linux/rtnetlink.h> | 17 | #include <linux/rtnetlink.h> |
18 | #include <linux/wireless.h> | 18 | #include <linux/wireless.h> |
19 | #include <net/iw_handler.h> | 19 | #include <net/wext.h> |
20 | 20 | ||
21 | #include "net-sysfs.h" | 21 | #include "net-sysfs.h" |
22 | 22 | ||
@@ -363,15 +363,13 @@ static ssize_t wireless_show(struct device *d, char *buf, | |||
363 | char *)) | 363 | char *)) |
364 | { | 364 | { |
365 | struct net_device *dev = to_net_dev(d); | 365 | struct net_device *dev = to_net_dev(d); |
366 | const struct iw_statistics *iw = NULL; | 366 | const struct iw_statistics *iw; |
367 | ssize_t ret = -EINVAL; | 367 | ssize_t ret = -EINVAL; |
368 | 368 | ||
369 | read_lock(&dev_base_lock); | 369 | read_lock(&dev_base_lock); |
370 | if (dev_isalive(dev)) { | 370 | if (dev_isalive(dev)) { |
371 | if (dev->wireless_handlers && | 371 | iw = get_wireless_stats(dev); |
372 | dev->wireless_handlers->get_wireless_stats) | 372 | if (iw) |
373 | iw = dev->wireless_handlers->get_wireless_stats(dev); | ||
374 | if (iw != NULL) | ||
375 | ret = (*format)(iw, buf); | 373 | ret = (*format)(iw, buf); |
376 | } | 374 | } |
377 | read_unlock(&dev_base_lock); | 375 | read_unlock(&dev_base_lock); |
@@ -505,7 +503,7 @@ int netdev_register_kobject(struct net_device *net) | |||
505 | *groups++ = &netstat_group; | 503 | *groups++ = &netstat_group; |
506 | 504 | ||
507 | #ifdef CONFIG_WIRELESS_EXT_SYSFS | 505 | #ifdef CONFIG_WIRELESS_EXT_SYSFS |
508 | if (net->wireless_handlers && net->wireless_handlers->get_wireless_stats) | 506 | if (net->wireless_handlers || net->ieee80211_ptr) |
509 | *groups++ = &wireless_group; | 507 | *groups++ = &wireless_group; |
510 | #endif | 508 | #endif |
511 | #endif /* CONFIG_SYSFS */ | 509 | #endif /* CONFIG_SYSFS */ |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 97a278a2f48e..8d26e9bf8964 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1388,8 +1388,8 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1388 | 1388 | ||
1389 | reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); | 1389 | reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); |
1390 | 1390 | ||
1391 | printk(KERN_DEBUG "%s: disassociated (Reason: %u)\n", | 1391 | printk(KERN_DEBUG "%s: disassociated from %pM (Reason: %u)\n", |
1392 | sdata->dev->name, reason_code); | 1392 | sdata->dev->name, mgmt->sa, reason_code); |
1393 | 1393 | ||
1394 | ieee80211_set_disassoc(sdata, false); | 1394 | ieee80211_set_disassoc(sdata, false); |
1395 | return RX_MGMT_CFG80211_DISASSOC; | 1395 | return RX_MGMT_CFG80211_DISASSOC; |
@@ -1675,7 +1675,7 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata, | |||
1675 | 1675 | ||
1676 | /* direct probe may be part of the association flow */ | 1676 | /* direct probe may be part of the association flow */ |
1677 | if (wk && wk->state == IEEE80211_MGD_STATE_PROBE) { | 1677 | if (wk && wk->state == IEEE80211_MGD_STATE_PROBE) { |
1678 | printk(KERN_DEBUG "%s direct probe responded\n", | 1678 | printk(KERN_DEBUG "%s: direct probe responded\n", |
1679 | sdata->dev->name); | 1679 | sdata->dev->name); |
1680 | wk->tries = 0; | 1680 | wk->tries = 0; |
1681 | wk->state = IEEE80211_MGD_STATE_AUTH; | 1681 | wk->state = IEEE80211_MGD_STATE_AUTH; |
@@ -2502,9 +2502,6 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
2502 | struct ieee80211_mgd_work *wk; | 2502 | struct ieee80211_mgd_work *wk; |
2503 | const u8 *bssid = NULL; | 2503 | const u8 *bssid = NULL; |
2504 | 2504 | ||
2505 | printk(KERN_DEBUG "%s: deauthenticating by local choice (reason=%d)\n", | ||
2506 | sdata->dev->name, req->reason_code); | ||
2507 | |||
2508 | mutex_lock(&ifmgd->mtx); | 2505 | mutex_lock(&ifmgd->mtx); |
2509 | 2506 | ||
2510 | if (ifmgd->associated && &ifmgd->associated->cbss == req->bss) { | 2507 | if (ifmgd->associated && &ifmgd->associated->cbss == req->bss) { |
@@ -2532,6 +2529,9 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
2532 | 2529 | ||
2533 | mutex_unlock(&ifmgd->mtx); | 2530 | mutex_unlock(&ifmgd->mtx); |
2534 | 2531 | ||
2532 | printk(KERN_DEBUG "%s: deauthenticating from %pM by local choice (reason=%d)\n", | ||
2533 | sdata->dev->name, bssid, req->reason_code); | ||
2534 | |||
2535 | ieee80211_send_deauth_disassoc(sdata, bssid, | 2535 | ieee80211_send_deauth_disassoc(sdata, bssid, |
2536 | IEEE80211_STYPE_DEAUTH, req->reason_code, | 2536 | IEEE80211_STYPE_DEAUTH, req->reason_code, |
2537 | cookie); | 2537 | cookie); |
@@ -2545,9 +2545,6 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, | |||
2545 | { | 2545 | { |
2546 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 2546 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
2547 | 2547 | ||
2548 | printk(KERN_DEBUG "%s: disassociating by local choice (reason=%d)\n", | ||
2549 | sdata->dev->name, req->reason_code); | ||
2550 | |||
2551 | mutex_lock(&ifmgd->mtx); | 2548 | mutex_lock(&ifmgd->mtx); |
2552 | 2549 | ||
2553 | /* | 2550 | /* |
@@ -2561,6 +2558,9 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, | |||
2561 | return -ENOLINK; | 2558 | return -ENOLINK; |
2562 | } | 2559 | } |
2563 | 2560 | ||
2561 | printk(KERN_DEBUG "%s: disassociating from %pM by local choice (reason=%d)\n", | ||
2562 | sdata->dev->name, req->bss->bssid, req->reason_code); | ||
2563 | |||
2564 | ieee80211_set_disassoc(sdata, false); | 2564 | ieee80211_set_disassoc(sdata, false); |
2565 | 2565 | ||
2566 | mutex_unlock(&ifmgd->mtx); | 2566 | mutex_unlock(&ifmgd->mtx); |
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 7fae7eee65de..93c3ed329204 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -762,9 +762,8 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev, | |||
762 | wdev->conn->params.ssid = wdev->ssid; | 762 | wdev->conn->params.ssid = wdev->ssid; |
763 | wdev->conn->params.ssid_len = connect->ssid_len; | 763 | wdev->conn->params.ssid_len = connect->ssid_len; |
764 | 764 | ||
765 | /* don't care about result -- but fill bssid & channel */ | 765 | /* see if we have the bss already */ |
766 | if (!wdev->conn->params.bssid || !wdev->conn->params.channel) | 766 | bss = cfg80211_get_conn_bss(wdev); |
767 | bss = cfg80211_get_conn_bss(wdev); | ||
768 | 767 | ||
769 | wdev->sme_state = CFG80211_SME_CONNECTING; | 768 | wdev->sme_state = CFG80211_SME_CONNECTING; |
770 | wdev->connect_keys = connkeys; | 769 | wdev->connect_keys = connkeys; |
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c index bf725275eb8d..5615a8802536 100644 --- a/net/wireless/wext-sme.c +++ b/net/wireless/wext-sme.c | |||
@@ -30,7 +30,8 @@ int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev, | |||
30 | if (wdev->wext.keys) { | 30 | if (wdev->wext.keys) { |
31 | wdev->wext.keys->def = wdev->wext.default_key; | 31 | wdev->wext.keys->def = wdev->wext.default_key; |
32 | wdev->wext.keys->defmgmt = wdev->wext.default_mgmt_key; | 32 | wdev->wext.keys->defmgmt = wdev->wext.default_mgmt_key; |
33 | wdev->wext.connect.privacy = true; | 33 | if (wdev->wext.default_key != -1) |
34 | wdev->wext.connect.privacy = true; | ||
34 | } | 35 | } |
35 | 36 | ||
36 | if (!wdev->wext.connect.ssid_len) | 37 | if (!wdev->wext.connect.ssid_len) |
@@ -229,8 +230,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev, | |||
229 | data->flags = 1; | 230 | data->flags = 1; |
230 | data->length = wdev->wext.connect.ssid_len; | 231 | data->length = wdev->wext.connect.ssid_len; |
231 | memcpy(ssid, wdev->wext.connect.ssid, data->length); | 232 | memcpy(ssid, wdev->wext.connect.ssid, data->length); |
232 | } else | 233 | } |
233 | data->flags = 0; | ||
234 | wdev_unlock(wdev); | 234 | wdev_unlock(wdev); |
235 | 235 | ||
236 | return 0; | 236 | return 0; |
@@ -306,8 +306,6 @@ int cfg80211_mgd_wext_giwap(struct net_device *dev, | |||
306 | wdev_lock(wdev); | 306 | wdev_lock(wdev); |
307 | if (wdev->current_bss) | 307 | if (wdev->current_bss) |
308 | memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN); | 308 | memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN); |
309 | else if (wdev->wext.connect.bssid) | ||
310 | memcpy(ap_addr->sa_data, wdev->wext.connect.bssid, ETH_ALEN); | ||
311 | else | 309 | else |
312 | memset(ap_addr->sa_data, 0, ETH_ALEN); | 310 | memset(ap_addr->sa_data, 0, ETH_ALEN); |
313 | wdev_unlock(wdev); | 311 | wdev_unlock(wdev); |
diff --git a/net/wireless/wext.c b/net/wireless/wext.c index 5b4a0cee4418..60fe57761ca9 100644 --- a/net/wireless/wext.c +++ b/net/wireless/wext.c | |||
@@ -470,7 +470,7 @@ static iw_handler get_handler(struct net_device *dev, unsigned int cmd) | |||
470 | /* | 470 | /* |
471 | * Get statistics out of the driver | 471 | * Get statistics out of the driver |
472 | */ | 472 | */ |
473 | static struct iw_statistics *get_wireless_stats(struct net_device *dev) | 473 | struct iw_statistics *get_wireless_stats(struct net_device *dev) |
474 | { | 474 | { |
475 | /* New location */ | 475 | /* New location */ |
476 | if ((dev->wireless_handlers != NULL) && | 476 | if ((dev->wireless_handlers != NULL) && |
@@ -773,10 +773,13 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd, | |||
773 | essid_compat = 1; | 773 | essid_compat = 1; |
774 | else if (IW_IS_SET(cmd) && (iwp->length != 0)) { | 774 | else if (IW_IS_SET(cmd) && (iwp->length != 0)) { |
775 | char essid[IW_ESSID_MAX_SIZE + 1]; | 775 | char essid[IW_ESSID_MAX_SIZE + 1]; |
776 | unsigned int len; | ||
777 | len = iwp->length * descr->token_size; | ||
776 | 778 | ||
777 | err = copy_from_user(essid, iwp->pointer, | 779 | if (len > IW_ESSID_MAX_SIZE) |
778 | iwp->length * | 780 | return -EFAULT; |
779 | descr->token_size); | 781 | |
782 | err = copy_from_user(essid, iwp->pointer, len); | ||
780 | if (err) | 783 | if (err) |
781 | return -EFAULT; | 784 | return -EFAULT; |
782 | 785 | ||