diff options
author | 2012-10-10 09:23:06 +0000 | |
---|---|---|
committer | 2012-10-10 09:23:06 +0000 | |
commit | 9abbd3c94e7b03bb0867f7965c635b083d743151 (patch) | |
tree | 6b6ed27923875ed17342093a42ea11ce2d48a79e | |
parent | Avoid potential uninitialized variable access in fxp driver. (diff) | |
download | wireguard-openbsd-9abbd3c94e7b03bb0867f7965c635b083d743151.tar.xz wireguard-openbsd-9abbd3c94e7b03bb0867f7965c635b083d743151.zip |
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@
-rw-r--r-- | sys/net80211/ieee80211_node.c | 12 |
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); |