Subject: [PATCH] d80211: Reset assoc and auth retry counters

From: Ivo van Doorn <[email-masked]>
Date: Tue, 28 Nov 2006 20:56:05 +0100

After a succesfull authentication and association the matching retry counter
must be reset to 0.
Failure to do so will result in failure to authenticate after the interface
has been deauthenticated. This does not always happen after the first
deauthentication, but after the interface has been several times been
deauthenticated it will refuse to authenticate.

Signed-off-by Ivo van Doorn <[email-masked]>

---

diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c
index deebbc7..04bd5cd 100644
--- a/net/d80211/ieee80211_sta.c
+++ b/net/d80211/ieee80211_sta.c
@@ -694,6 +694,7 @@ static void ieee80211_associated(struct
 	/* TODO: remove expired BSSes */
 
 	ifsta->state = IEEE80211_ASSOCIATED;
+	ifsta->assoc_tries = 0;
 
 	sta = sta_info_get(local, ifsta->bssid);
 	if (!sta) {
@@ -821,6 +822,7 @@ static void ieee80211_auth_completed(str
 {
 	printk(KERN_DEBUG "%s: authenticated\n", dev->name);
 	ifsta->authenticated = 1;
+	ifsta->auth_tries = 0;
 	ieee80211_associate(dev, ifsta);
 }