summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2012-11-25 23:13:42 +0100
committerJohannes Berg <johannes.berg@intel.com>2012-11-26 11:31:39 +0100
commite584da5e3cc0b299d4b86072941cbe6dd9a046a8 (patch)
tree037994e269c1b206ca25e579fa416efd3585501a /net/mac80211
parentc216e6417f473ab4666f539844652bf2f4129777 (diff)
downloadlinux-e584da5e3cc0b299d4b86072941cbe6dd9a046a8.tar.gz
linux-e584da5e3cc0b299d4b86072941cbe6dd9a046a8.tar.bz2
linux-e584da5e3cc0b299d4b86072941cbe6dd9a046a8.zip
mac80211: in ADHOC don't update last_rx if sta is not authorized
It does not make sense to keep a station alive if it is not authorised at all. If IBSS/RSN is used it could also be the case that something went wrong during the keys exchange and the stations ended up in a not recoverable state. By not updating last_rx we are giving the station a chance to be deleted and to start the key exchange once again from scratch. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/rx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index ec879029ac43..b2ae2baefc9a 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1341,13 +1341,17 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
/*
* Update last_rx only for IBSS packets which are for the current
- * BSSID to avoid keeping the current IBSS network alive in cases
- * where other STAs start using different BSSID.
+ * BSSID and for station already AUTHORIZED to avoid keeping the
+ * current IBSS network alive in cases where other STAs start
+ * using different BSSID. This will also give the station another
+ * chance to restart the authentication/authorization in case
+ * something went wrong the first time.
*/
if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) {
u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len,
NL80211_IFTYPE_ADHOC);
- if (ether_addr_equal(bssid, rx->sdata->u.ibss.bssid)) {
+ if (ether_addr_equal(bssid, rx->sdata->u.ibss.bssid) &&
+ test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {
sta->last_rx = jiffies;
if (ieee80211_is_data(hdr->frame_control)) {
sta->last_rx_rate_idx = status->rate_idx;