-/* $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 $ */
/*-
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)