[PATCH] ieee80211: Keep auth mode unchanged after iwconfig key off/on cycle
authorJames Ketrenos <jketreno@linux.intel.com>
Wed, 21 Sep 2005 16:58:38 +0000 (11:58 -0500)
committerJeff Garzik <jgarzik@pobox.com>
Thu, 22 Sep 2005 03:04:57 +0000 (23:04 -0400)
tree 2e6f6e7dc4f4eeb8e3dc265020016dd53e40578a
parent ba2075794a089430b3dd7c90ff46ce1b67e9c7cc
author Zhu Yi <yi.zhu@intel.com> 1125551043 +0800
committer James Ketrenos <jketreno@linux.intel.com> 1127314475 -0500

[Bug 768] Keep auth mode unchanged after iwconfig key off/on cycle.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
net/ieee80211/ieee80211_wx.c

index d710f47c4bd5869c703e9e315820d8296d266cf1..65aa96da730dc3d59c73fb52e0f29aac18a5ffea 100644 (file)
@@ -412,11 +412,15 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
                        sec.flags |= SEC_ACTIVE_KEY;
                }
        }
-       ieee->open_wep = !(erq->flags & IW_ENCODE_RESTRICTED);
-       sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY;
-       sec.flags |= SEC_AUTH_MODE;
-       IEEE80211_DEBUG_WX("Auth: %s\n", sec.auth_mode == WLAN_AUTH_OPEN ?
-                          "OPEN" : "SHARED KEY");
+       if (erq->flags & (IW_ENCODE_OPEN | IW_ENCODE_RESTRICTED)) {
+               ieee->open_wep = !(erq->flags & IW_ENCODE_RESTRICTED);
+               sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN :
+                   WLAN_AUTH_SHARED_KEY;
+               sec.flags |= SEC_AUTH_MODE;
+               IEEE80211_DEBUG_WX("Auth: %s\n",
+                                  sec.auth_mode == WLAN_AUTH_OPEN ?
+                                  "OPEN" : "SHARED KEY");
+       }
 
        /* For now we just support WEP, so only set that security level...
         * TODO: When WPA is added this is one place that needs to change */