]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath6kl: Fix connect command to clear previously used IEs
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 15 Dec 2011 12:16:00 +0000 (14:16 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 23 Dec 2011 12:42:44 +0000 (14:42 +0200)
Empty IE buffer means that the new association is not supposed to
include extra IEs. Make sure any previously configured (Re)Association
Request frame IEs get cleared in such a case. This is based on a patch
from Shuibing.

Cc: Dai Shuibing <shuibing@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/cfg80211.c

index 85c24dd015656f4afbe476d66ec4b5397ebdb9ae..1a06a04c5106581b425cd0247e5f730e59ce2120 100644 (file)
@@ -461,13 +461,13 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
                }
        }
 
-       if (sme->ie && (sme->ie_len > 0)) {
-               status = ath6kl_set_assoc_req_ies(vif, sme->ie, sme->ie_len);
-               if (status) {
-                       up(&ar->sem);
-                       return status;
-               }
-       } else
+       status = ath6kl_set_assoc_req_ies(vif, sme->ie, sme->ie_len);
+       if (status) {
+               up(&ar->sem);
+               return status;
+       }
+
+       if (sme->ie == NULL || sme->ie_len == 0)
                ar->connect_ctrl_flags &= ~CONNECT_WPS_FLAG;
 
        if (test_bit(CONNECTED, &vif->flags) &&