From c0bda9303ebf1a2f229612ddb0c5e56daff7acb8 Mon Sep 17 00:00:00 2001 From: stsp Date: Tue, 12 Dec 2017 15:57:11 +0000 Subject: [PATCH] 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@ --- sys/net80211/ieee80211_input.c | 20 +++++++++++--------- 1 file 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 -- 2.20.1