From 78485475618cf9f1c70dc7f15e8deafa8b6074ab Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 7 Jul 2009 03:56:05 +0200 Subject: 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 Signed-off-by: John W. Linville --- net/wireless/ibss.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/wireless/ibss.c') diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index c92b542..a5330c5 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) 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) -- cgit v1.1