From 141980432e7552b67c3304d368ac8a06ecb358d3 Mon Sep 17 00:00:00 2001 From: phessler Date: Tue, 12 Dec 2017 13:38:10 +0000 Subject: [PATCH] Allow interfaces that aren't SCANNALLBAND drivers to benefit from the strongest received signal. OK stsp@ --- sys/net80211/ieee80211_node.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index f77766cc45d..57641fac24a 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.c,v 1.123 2017/12/12 00:24:21 jcs Exp $ */ +/* $OpenBSD: ieee80211_node.c,v 1.124 2017/12/12 13:38:10 phessler Exp $ */ /* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */ /*- @@ -771,14 +771,15 @@ ieee80211_end_scan(struct ifnet *ifp) if (ieee80211_match_bss(ic, ni) != 0) continue; - if ((ic->ic_caps & IEEE80211_C_SCANALLBAND) && - IEEE80211_IS_CHAN_2GHZ(ni->ni_chan) && - (selbs2 == NULL || ni->ni_rssi > selbs2->ni_rssi)) - selbs2 = ni; - else if ((ic->ic_caps & IEEE80211_C_SCANALLBAND) && - IEEE80211_IS_CHAN_5GHZ(ni->ni_chan) && - (selbs5 == NULL || ni->ni_rssi > selbs5->ni_rssi)) - selbs5 = ni; + if (ic->ic_caps & IEEE80211_C_SCANALLBAND) { + if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan) && + (selbs2 == NULL || ni->ni_rssi > selbs2->ni_rssi)) + selbs2 = ni; + else if (IEEE80211_IS_CHAN_5GHZ(ni->ni_chan) && + (selbs5 == NULL || ni->ni_rssi > selbs5->ni_rssi)) + selbs5 = ni; + } else if (selbs == NULL || ni->ni_rssi > selbs->ni_rssi) + selbs = ni; } if (ic->ic_max_rssi) -- 2.20.1