netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: netdev@vger.kernel.org, "John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH 04/14] ipw2200: Reassociate even if set the same essid.
Date: Mon, 21 Aug 2006 11:37:26 +0800	[thread overview]
Message-ID: <20060821033726.GA5353@mail.intel.com> (raw)

This patch traps the case when the essid is being set to its
current value. If the essid is being set again and we are already
associated, chances are some other parameters have also been altered.
I think it is safer to do the re-association for this case.

Signed-off-by: Bill Moss <bmoss@clemson.edu>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>

---

 drivers/net/wireless/ipw2200.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

17e85d1ad3dd9c8dc48d63dcc6cd531b3b8fb685
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 27e87d1..e929f88 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8837,7 +8837,6 @@ static int ipw_wx_set_essid(struct net_d
 			    union iwreq_data *wrqu, char *extra)
 {
 	struct ipw_priv *priv = ieee80211_priv(dev);
-        char *essid;
         int length;
 
         mutex_lock(&priv->mutex);
@@ -8852,12 +8851,14 @@ static int ipw_wx_set_essid(struct net_d
                 return 0;
         }
 
-	length = min(wrqu->essid.length, IW_ESSID_MAX_SIZE);
-	essid = extra;
+	length = min((int)wrqu->essid.length, IW_ESSID_MAX_SIZE);
+	if (!extra[length - 1])
+		length--;
 
 	priv->config |= CFG_STATIC_ESSID;
 
-	if (priv->essid_len == length && !memcmp(priv->essid, extra, length)) {
+	if (priv->essid_len == length && !memcmp(priv->essid, extra, length)
+	    && (priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) {
 		IPW_DEBUG_WX("ESSID set to current ESSID.\n");
 		mutex_unlock(&priv->mutex);
 		return 0;
@@ -8867,7 +8868,7 @@ static int ipw_wx_set_essid(struct net_d
 		     length);
 
 	priv->essid_len = length;
-	memcpy(priv->essid, essid, priv->essid_len);
+	memcpy(priv->essid, extra, priv->essid_len);
 
 	/* Network configuration changed -- force [re]association */
 	IPW_DEBUG_ASSOC("[re]association triggered due to ESSID change.\n");
-- 
1.2.6

                 reply	other threads:[~2006-08-21  3:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060821033726.GA5353@mail.intel.com \
    --to=yi.zhu@intel.com \
    --cc=linville@tuxdriver.com \
    --cc=netdev@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).