summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2017-12-12 15:57:11 +0000
committerstsp <stsp@openbsd.org>2017-12-12 15:57:11 +0000
commitc0bda9303ebf1a2f229612ddb0c5e56daff7acb8 (patch)
treec66c4d9a378d1f54b50fd637195a580aaf83fea3
parentMake ieee80211_chan2ieee() panic if a bogus channel pointer is detected. (diff)
downloadwireguard-openbsd-c0bda9303ebf1a2f229612ddb0c5e56daff7acb8.tar.xz
wireguard-openbsd-c0bda9303ebf1a2f229612ddb0c5e56daff7acb8.zip
Only trigger background scans while we are in RUN state, and do not update
a node's RSSI info while we are still in INIT state. ok phessler@
-rw-r--r--sys/net80211/ieee80211_input.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index be869244e40..304c13c3444 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_input.c,v 1.197 2017/12/08 21:16:01 stsp Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.198 2017/12/12 15:57:11 stsp Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -263,18 +263,20 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
}
*orxseq = nrxseq;
}
- if (ic->ic_state != IEEE80211_S_SCAN) {
+ if (ic->ic_state > IEEE80211_S_SCAN) {
ni->ni_rssi = rxi->rxi_rssi;
ni->ni_rstamp = rxi->rxi_tstamp;
ni->ni_inact = 0;
- /* Cancel or start background scan based on RSSI. */
- if ((*ic->ic_node_checkrssi)(ic, ni))
- timeout_del(&ic->ic_bgscan_timeout);
- else if (!timeout_pending(&ic->ic_bgscan_timeout) &&
- (ic->ic_flags & IEEE80211_F_BGSCAN) == 0)
- timeout_add_msec(&ic->ic_bgscan_timeout,
- 500 * (ic->ic_bgscan_fail + 1));
+ if (ic->ic_state == IEEE80211_S_RUN) {
+ /* Cancel or start background scan based on RSSI. */
+ if ((*ic->ic_node_checkrssi)(ic, ni))
+ timeout_del(&ic->ic_bgscan_timeout);
+ else if (!timeout_pending(&ic->ic_bgscan_timeout) &&
+ (ic->ic_flags & IEEE80211_F_BGSCAN) == 0)
+ timeout_add_msec(&ic->ic_bgscan_timeout,
+ 500 * (ic->ic_bgscan_fail + 1));
+ }
}
#ifndef IEEE80211_STA_ONLY