summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2012-10-10 09:23:07 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2012-10-10 09:23:07 +0000
commit31f171227d43fb6c7f1cef3e1779c1bc9b65aa81 (patch)
tree38a398754db387a282d4802205cb78b32d9f4daa /sys
parent6ea51f94a9bc8f339c1afa370069ce3c067ad6be (diff)
Clear the powersave flag and purge queued packets when a node leaves the AP
(either by disassociating or by timeout). Fixes (most) remaining issues with power saving. From Nathanael Rensen. ok claudio@, krw@, sthen@
Diffstat (limited to 'sys')
-rw-r--r--sys/net80211/ieee80211_node.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 7f9a6a8c36b..ca6cd9f398e 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.75 2012/10/05 17:17:04 camield Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.76 2012/10/10 09:23:06 kettenis Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -1604,8 +1604,16 @@ ieee80211_node_leave(struct ieee80211com *ic, struct ieee80211_node *ni)
return;
}
- if (ni->ni_pwrsave == IEEE80211_PS_DOZE)
+ if (ni->ni_pwrsave == IEEE80211_PS_DOZE) {
ic->ic_pssta--;
+ ni->ni_pwrsave = IEEE80211_PS_AWAKE;
+ }
+
+ if (!IF_IS_EMPTY(&ni->ni_savedq)) {
+ IF_PURGE(&ni->ni_savedq);
+ if (ic->ic_set_tim != NULL)
+ (*ic->ic_set_tim)(ic, ni->ni_associd, 0);
+ }
if (ic->ic_flags & IEEE80211_F_RSNON)
ieee80211_node_leave_rsn(ic, ni);