diff options
author | Peter Hessler <phessler@cvs.openbsd.org> | 2017-12-12 13:38:11 +0000 |
---|---|---|
committer | Peter Hessler <phessler@cvs.openbsd.org> | 2017-12-12 13:38:11 +0000 |
commit | 0b9f4d571f0b31079c2ecfb1205778c639f8d4fd (patch) | |
tree | 7ba1c80b77a8cbb608fe471bb7f75d4316f898e1 /sys/net80211 | |
parent | c9c258d226c375413c347d41dcfb3f86d52df7d8 (diff) |
Allow interfaces that aren't SCANNALLBAND drivers to benefit from the
strongest received signal.
OK stsp@
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_node.c | 19 |
1 files 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) |