From: Samuel Ortiz <samuel.ortiz@intel.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: [PATCH] cfg80211: set conn.state properly in the connect() case
Date: Tue, 30 Jun 2009 17:35:26 +0200 [thread overview]
Message-ID: <20090630153522.GA28206@sortiz.org> (raw)
In-Reply-To: <20090630115301.625487032@sipsolutions.net>
We need to set the conn.state to ASSOCIATING for the ->connect() path. By
default, it is set to 0, i.e. SCANNING, which causes sme_scan_done() to
eventually call conn_do_work(), which then would call assoc() and auth()
blindly. That's why we also bug on those hooks not being defined there.
Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
---
net/wireless/sme.c | 3 +++
1 file changed, 3 insertions(+)
Index: iwm-2.6/net/wireless/sme.c
===================================================================
--- iwm-2.6.orig/net/wireless/sme.c 2009-06-30 16:39:58.000000000 +0200
+++ iwm-2.6/net/wireless/sme.c 2009-06-30 17:17:14.000000000 +0200
@@ -103,6 +103,7 @@ static int cfg80211_conn_do_work(struct
u.auth_req.ie = NULL;
u.auth_req.ie_len = 0;
wdev->conn.state = CFG80211_CONN_AUTHENTICATING;
+ BUG_ON(!drv->ops->auth);
return drv->ops->auth(wdev->wiphy, wdev->netdev, &u.auth_req);
case CFG80211_CONN_ASSOCIATE_NEXT:
u.assoc_req.chan = wdev->conn.params.channel;
@@ -115,6 +116,7 @@ static int cfg80211_conn_do_work(struct
memcpy(&u.assoc_req.crypto, &wdev->conn.params.crypto,
sizeof(u.assoc_req.crypto));
wdev->conn.state = CFG80211_CONN_ASSOCIATING;
+ BUG_ON(!drv->ops->assoc);
return drv->ops->assoc(wdev->wiphy, wdev->netdev,
&u.assoc_req);
default:
@@ -455,6 +457,7 @@ int cfg80211_connect(struct cfg80211_reg
return err;
} else {
wdev->sme_state = CFG80211_SME_CONNECTING;
+ wdev->conn.state = CFG80211_CONN_ASSOCIATING;
err = rdev->ops->connect(&rdev->wiphy, dev, connect);
if (err) {
wdev->sme_state = CFG80211_SME_IDLE;
--
Intel Open Source Technology Centre
http://oss.intel.com/
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
next prev parent reply other threads:[~2009-06-30 15:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 11:52 [PATCH 0/8 v3] connect API, wext conversion Johannes Berg
2009-06-30 11:52 ` [PATCH 1/8 v3] cfg80211: connect/disconnect API Johannes Berg
2009-06-30 15:35 ` Samuel Ortiz [this message]
2009-07-01 10:58 ` [PATCH] cfg80211: set conn.state properly in the connect() case Johannes Berg
2009-06-30 15:45 ` [PATCH RFC] iwmc3200wifi: connect API port Samuel Ortiz
2009-06-30 11:52 ` [PATCH 2/8 v3] cfg80211: emulate connect with auth/assoc Johannes Berg
2009-06-30 11:52 ` [PATCH 3/8 v3] cfg80211: managed mode wext compatibility Johannes Berg
2009-06-30 11:52 ` [PATCH 4/8 v3] cfg80211: implement iwpower Johannes Berg
2009-06-30 11:52 ` [PATCH 5/8 v3] cfg80211: implement IWAP for WDS Johannes Berg
2009-06-30 11:52 ` [PATCH 6/8 v3] cfg80211: implement IWRATE Johannes Berg
2009-06-30 11:52 ` [PATCH 7/8 v3] cfg80211: implement get_wireless_stats Johannes Berg
2009-06-30 11:52 ` [PATCH 8/8 v3] mac80211: re-add HT disabling Johannes Berg
2009-06-30 13:25 ` Vasanthakumar Thiagarajan
2009-06-30 13:37 ` Johannes Berg
2009-06-30 13:52 ` Vasanthakumar Thiagarajan
2009-06-30 14:00 ` Johannes Berg
2009-07-01 7:39 ` [PATCH 8/8 v3.1] " Johannes Berg
2009-07-01 10:13 ` Vasanthakumar Thiagarajan
2009-07-01 10:42 ` Johannes Berg
2009-07-02 9:51 ` Jouni Malinen
2009-07-02 9:53 ` Johannes Berg
2009-07-02 11:43 ` Jouni Malinen
2009-07-02 11:56 ` 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=20090630153522.GA28206@sortiz.org \
--to=samuel.ortiz@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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).