diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-06 21:56:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:02:31 -0400 |
commit | 78485475618cf9f1c70dc7f15e8deafa8b6074ab (patch) | |
tree | c31ebe1540016bbe1fdc41ac5b671cdc2bf143ed /net/wireless | |
parent | c9cf01226e0bd1fa4f7f7024d8d53e982fad208f (diff) |
cfg80211: fix netdev down problem
We shouldn't be looking at the ssid_len for non-IBSS,
and for IBSS we should also return an error on trying
to leave an IBSS while not in or joining an IBSS.
This fixes an issue where we wouldn't disconnect() on
an interface being taken down since there's no SSID
configured this way.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.c | 3 | ||||
-rw-r--r-- | net/wireless/ibss.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 7b66cf15349a..83ec7197bd7c 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -567,9 +567,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
567 | #endif | 567 | #endif |
568 | break; | 568 | break; |
569 | case NETDEV_GOING_DOWN: | 569 | case NETDEV_GOING_DOWN: |
570 | if (!wdev->ssid_len) | ||
571 | break; | ||
572 | |||
573 | switch (wdev->iftype) { | 570 | switch (wdev->iftype) { |
574 | case NL80211_IFTYPE_ADHOC: | 571 | case NL80211_IFTYPE_ADHOC: |
575 | cfg80211_leave_ibss(rdev, dev, true); | 572 | cfg80211_leave_ibss(rdev, dev, true); |
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index c92b542d54b0..a5330c5a5477 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c | |||
@@ -92,8 +92,12 @@ void cfg80211_clear_ibss(struct net_device *dev, bool nowext) | |||
92 | int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev, | 92 | int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev, |
93 | struct net_device *dev, bool nowext) | 93 | struct net_device *dev, bool nowext) |
94 | { | 94 | { |
95 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
95 | int err; | 96 | int err; |
96 | 97 | ||
98 | if (!wdev->ssid_len) | ||
99 | return -ENOLINK; | ||
100 | |||
97 | err = rdev->ops->leave_ibss(&rdev->wiphy, dev); | 101 | err = rdev->ops->leave_ibss(&rdev->wiphy, dev); |
98 | 102 | ||
99 | if (err) | 103 | if (err) |