Skip to content

Commit

Permalink
cfg80211: fix netdev down problem
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jul 10, 2009
1 parent c9cf012 commit 7848547
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
#endif
break;
case NETDEV_GOING_DOWN:
if (!wdev->ssid_len)
break;

switch (wdev->iftype) {
case NL80211_IFTYPE_ADHOC:
cfg80211_leave_ibss(rdev, dev, true);
Expand Down
4 changes: 4 additions & 0 deletions net/wireless/ibss.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ void cfg80211_clear_ibss(struct net_device *dev, bool nowext)
int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
struct net_device *dev, bool nowext)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
int err;

if (!wdev->ssid_len)
return -ENOLINK;

err = rdev->ops->leave_ibss(&rdev->wiphy, dev);

if (err)
Expand Down

0 comments on commit 7848547

Please sign in to comment.