aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/wireless/core.c2
-rw-r--r--net/wireless/core.h4
-rw-r--r--net/wireless/ibss.c21
-rw-r--r--net/wireless/nl80211.c4
4 files changed, 19 insertions, 12 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index f256b4f7e833..2006a4ee60eb 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -464,7 +464,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
464 break; 464 break;
465 if (!dev->ieee80211_ptr->ssid_len) 465 if (!dev->ieee80211_ptr->ssid_len)
466 break; 466 break;
467 cfg80211_leave_ibss(rdev, dev); 467 cfg80211_leave_ibss(rdev, dev, true);
468 break; 468 break;
469 case NETDEV_UP: 469 case NETDEV_UP:
470#ifdef CONFIG_WIRELESS_EXT 470#ifdef CONFIG_WIRELESS_EXT
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 89a8159ef0b1..3e49d3399311 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -147,8 +147,8 @@ void cfg80211_bss_age(struct cfg80211_registered_device *dev,
147int cfg80211_join_ibss(struct cfg80211_registered_device *rdev, 147int cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
148 struct net_device *dev, 148 struct net_device *dev,
149 struct cfg80211_ibss_params *params); 149 struct cfg80211_ibss_params *params);
150void cfg80211_clear_ibss(struct net_device *dev); 150void cfg80211_clear_ibss(struct net_device *dev, bool nowext);
151int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev, 151int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
152 struct net_device *dev); 152 struct net_device *dev, bool nowext);
153 153
154#endif /* __NET_WIRELESS_CORE_H */ 154#endif /* __NET_WIRELESS_CORE_H */
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index 4e1fcb0c9e4c..b5c601e1b1b7 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -76,7 +76,7 @@ int cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
76 return 0; 76 return 0;
77} 77}
78 78
79void cfg80211_clear_ibss(struct net_device *dev) 79void cfg80211_clear_ibss(struct net_device *dev, bool nowext)
80{ 80{
81 struct wireless_dev *wdev = dev->ieee80211_ptr; 81 struct wireless_dev *wdev = dev->ieee80211_ptr;
82 82
@@ -88,10 +88,14 @@ void cfg80211_clear_ibss(struct net_device *dev)
88 wdev->current_bss = NULL; 88 wdev->current_bss = NULL;
89 wdev->ssid_len = 0; 89 wdev->ssid_len = 0;
90 memset(wdev->bssid, 0, ETH_ALEN); 90 memset(wdev->bssid, 0, ETH_ALEN);
91#ifdef CONFIG_WIRELESS_EXT
92 if (!nowext)
93 wdev->wext.ssid_len = 0;
94#endif
91} 95}
92 96
93int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev, 97int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
94 struct net_device *dev) 98 struct net_device *dev, bool nowext)
95{ 99{
96 int err; 100 int err;
97 101
@@ -100,7 +104,7 @@ int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
100 if (err) 104 if (err)
101 return err; 105 return err;
102 106
103 cfg80211_clear_ibss(dev); 107 cfg80211_clear_ibss(dev, nowext);
104 108
105 return 0; 109 return 0;
106} 110}
@@ -179,7 +183,8 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
179 return 0; 183 return 0;
180 184
181 if (wdev->ssid_len) { 185 if (wdev->ssid_len) {
182 err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy), dev); 186 err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy),
187 dev, true);
183 if (err) 188 if (err)
184 return err; 189 return err;
185 } 190 }
@@ -241,7 +246,8 @@ int cfg80211_ibss_wext_siwessid(struct net_device *dev,
241 return -EOPNOTSUPP; 246 return -EOPNOTSUPP;
242 247
243 if (wdev->ssid_len) { 248 if (wdev->ssid_len) {
244 err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy), dev); 249 err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy),
250 dev, true);
245 if (err) 251 if (err)
246 return err; 252 return err;
247 } 253 }
@@ -275,7 +281,7 @@ int cfg80211_ibss_wext_giwessid(struct net_device *dev,
275 data->flags = 1; 281 data->flags = 1;
276 data->length = wdev->ssid_len; 282 data->length = wdev->ssid_len;
277 memcpy(ssid, wdev->ssid, data->length); 283 memcpy(ssid, wdev->ssid, data->length);
278 } else if (wdev->wext.ssid) { 284 } else if (wdev->wext.ssid && wdev->wext.ssid_len) {
279 data->flags = 1; 285 data->flags = 1;
280 data->length = wdev->wext.ssid_len; 286 data->length = wdev->wext.ssid_len;
281 memcpy(ssid, wdev->wext.ssid, data->length); 287 memcpy(ssid, wdev->wext.ssid, data->length);
@@ -318,7 +324,8 @@ int cfg80211_ibss_wext_siwap(struct net_device *dev,
318 return 0; 324 return 0;
319 325
320 if (wdev->ssid_len) { 326 if (wdev->ssid_len) {
321 err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy), dev); 327 err = cfg80211_leave_ibss(wiphy_to_dev(wdev->wiphy),
328 dev, true);
322 if (err) 329 if (err)
323 return err; 330 return err;
324 } 331 }
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 5a9a5c6c71db..97bb5c80125d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -833,7 +833,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
833 833
834 if (dev && !err && (ntype != otype)) { 834 if (dev && !err && (ntype != otype)) {
835 if (otype == NL80211_IFTYPE_ADHOC) 835 if (otype == NL80211_IFTYPE_ADHOC)
836 cfg80211_clear_ibss(dev); 836 cfg80211_clear_ibss(dev, false);
837 } 837 }
838 838
839 unlock: 839 unlock:
@@ -3249,7 +3249,7 @@ static int nl80211_leave_ibss(struct sk_buff *skb, struct genl_info *info)
3249 goto out; 3249 goto out;
3250 } 3250 }
3251 3251
3252 err = cfg80211_leave_ibss(drv, dev); 3252 err = cfg80211_leave_ibss(drv, dev, false);
3253 3253
3254out: 3254out:
3255 cfg80211_put_dev(drv); 3255 cfg80211_put_dev(drv);