summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2017-09-04 09:11:46 +0000
committerstsp <stsp@openbsd.org>2017-09-04 09:11:46 +0000
commit69759a962359ea62d91f1cc135fbc6f38b826d4d (patch)
tree1348f8055f74adf5173dc258f4b55ec7d62046fe
parenttweak previous; (diff)
downloadwireguard-openbsd-69759a962359ea62d91f1cc135fbc6f38b826d4d.tar.xz
wireguard-openbsd-69759a962359ea62d91f1cc135fbc6f38b826d4d.zip
If a beacon is received in RUN state, reset the management timer.
Some wifi drivers send a probe request if the hardware reports "missed beacon" events. If the AP replies with a probe response it is still servicing us and there is no need to search for a new AP. However, the management timer was not reset if a beacon was received while in RUN state. So the interface watchdog always ended up putting the driver into SCAN state after a missed beacon event, even if the AP did respond to our probe request. Under some conditions this bug would cause spurious disconnects. Problem reported and fix tested by mlarkin@ (Using the management timer in RUN state is a new convention. Before support for missed beacons was added, this timer was only used during the association sequence to handle APs which don't respond to our assoc requests and such.)
-rw-r--r--sys/net80211/ieee80211_input.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 85a5e4aea0c..e7add1e4a75 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_input.c,v 1.195 2017/08/04 17:31:05 stsp Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.196 2017/09/04 09:11:46 stsp Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -1582,6 +1582,14 @@ ieee80211_recv_probe_resp(struct ieee80211com *ic, struct mbuf *m,
ic->ic_curmode == IEEE80211_MODE_11A ||
(capinfo & IEEE80211_CAPINFO_SHORT_SLOTTIME));
}
+
+ /*
+ * Reset management timer. If it is non-zero in RUN state, the
+ * driver sent a probe request after a missed beacon event.
+ * This probe response indicates the AP is still serving us
+ * so don't allow ieee80211_watchdog() to move us into SCAN.
+ */
+ ic->ic_mgt_timer = 0;
}
/*
* We do not try to update EDCA parameters if QoS was not negotiated