linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 1/9] cfg80211: fix netdev down problem
Date: Tue, 07 Jul 2009 03:56:05 +0200	[thread overview]
Message-ID: <20090707015708.142063056@sipsolutions.net> (raw)
In-Reply-To: 20090707015604.369008211@sipsolutions.net

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>
---
 net/wireless/core.c |    3 ---
 net/wireless/ibss.c |    4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

--- wireless-testing.orig/net/wireless/core.c	2009-07-07 03:29:39.000000000 +0200
+++ wireless-testing/net/wireless/core.c	2009-07-07 03:37:03.000000000 +0200
@@ -567,9 +567,6 @@ static int cfg80211_netdev_notifier_call
 #endif
 		break;
 	case NETDEV_GOING_DOWN:
-		if (!wdev->ssid_len)
-			break;
-
 		switch (wdev->iftype) {
 		case NL80211_IFTYPE_ADHOC:
 			cfg80211_leave_ibss(rdev, dev, true);
--- wireless-testing.orig/net/wireless/ibss.c	2009-07-07 03:29:39.000000000 +0200
+++ wireless-testing/net/wireless/ibss.c	2009-07-07 03:37:03.000000000 +0200
@@ -92,8 +92,12 @@ void cfg80211_clear_ibss(struct net_devi
 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)

-- 


  reply	other threads:[~2009-07-07  2:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07  1:56 [PATCH 0/9] cfg80211 fixes, cleanups, improvements Johannes Berg
2009-07-07  1:56 ` Johannes Berg [this message]
2009-07-07  1:56 ` [PATCH 2/9] cfg80211: dont use union for wext Johannes Berg
2009-07-07  1:56 ` [PATCH 3/9] cfg80211: mlme API must be able to sleep Johannes Berg
2009-07-07  1:56 ` [PATCH 4/9] cfg80211: warn again on spurious deauth Johannes Berg
2009-07-07  1:56 ` [PATCH 5/9] cfg80211: properly name driver locking Johannes Berg
2009-07-07  1:56 ` [PATCH 6/9] cfg80211: fix MFP bug, sparse warnings Johannes Berg
2009-07-07  1:56 ` [PATCH 7/9] cfg80211: fix locking Johannes Berg
2009-07-07  1:56 ` [PATCH 8/9] cfg80211: clean up naming once and for all Johannes Berg
2009-07-07  1:56 ` [PATCH 9/9] cfg80211: disallow configuring unsupported interfaces Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090707015708.142063056@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).