summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2016-05-02 09:35:49 +0000
committertb <tb@openbsd.org>2016-05-02 09:35:49 +0000
commit2f33e90fab7d08df57881458b363fc973cd464e1 (patch)
tree89e03e8713cfcd8a03a5f4e924296ea630a0427f
parentMerge two identical code paths. (diff)
downloadwireguard-openbsd-2f33e90fab7d08df57881458b363fc973cd464e1.tar.xz
wireguard-openbsd-2f33e90fab7d08df57881458b363fc973cd464e1.zip
Fix a corner case of 12-bit arithmetic: also increment the ba_winmiss
counter if sn == 0 and ba_missedsn == 0xfff. ok stsp@
-rw-r--r--sys/net80211/ieee80211_input.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 8c602488122..32bfac7e84a 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_input.c,v 1.175 2016/05/02 08:12:42 stsp Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.176 2016/05/02 09:35:49 tb Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -722,7 +722,7 @@ ieee80211_input_ba(struct ieee80211com *ic, struct mbuf *m,
* and let the window move forward if neccessary.
*/
if (ba->ba_winmiss < IEEE80211_BA_MAX_WINMISS) {
- if (ba->ba_missedsn == sn - 1)
+ if (ba->ba_missedsn == ((sn - 1) & 0xfff))
ba->ba_winmiss++;
else
ba->ba_winmiss = 0;