summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ipw2200.c
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2006-08-21 11:37:26 +0800
committerJohn W. Linville <linville@tuxdriver.com>2006-08-29 17:06:32 -0400
commita9f0d42321a7ac40d244a7c6d74a3d1c7a4aa4f3 (patch)
tree1af416fbb674aaba4aa9d4023f04f40a06f35367 /drivers/net/wireless/ipw2200.c
parentab644b0b51bf3170b398c087b7a34be6d3c7b7ba (diff)
[PATCH] ipw2200: Reassociate even if set the same essid.
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ipw2200.c')
-rw-r--r--drivers/net/wireless/ipw2200.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 27e87d1b9f44..e929f880dea0 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_device *dev,
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_device *dev,
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_device *dev,
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");