From 0b9f4d571f0b31079c2ecfb1205778c639f8d4fd Mon Sep 17 00:00:00 2001 From: Peter Hessler Date: Tue, 12 Dec 2017 13:38:11 +0000 Subject: 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(-) (limited to 'sys/net80211') 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) -- cgit v1.2.3