aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/sme.c5
-rw-r--r--net/wireless/wext-sme.c8
-rw-r--r--net/wireless/wext.c11
3 files changed, 12 insertions, 12 deletions
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 */
473static struct iw_statistics *get_wireless_stats(struct net_device *dev) 473struct 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