From 925119074dd8d8d81465788eeefbd7f231ff8231 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 22 Mar 2012 11:50:11 -0500 Subject: [PATCH] wifi: work around more wl.o stupidity Sometimes returns 0 for the current frequency when the radio is active. WTF? --- src/nm-device-wifi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 2f4ba00874..ed964a5768 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -594,9 +594,10 @@ get_active_ap (NMDeviceWifi *self, * is uncommon though, and the frequency check penalizes closed drivers we * can't fix. Because we're not total dicks, ignore the frequency condition * if the associated BSSID/SSID exists only in one band since that's most - * likely the AP we want. + * likely the AP we want. Sometimes wl.o returns a frequency of 0, so if + * we can't match the AP based on frequency at all, just give up. */ - if (match_nofreq && (found_a_band != found_bg_band)) { + if (match_nofreq && ((found_a_band != found_bg_band) || (devfreq == 0))) { const struct ether_addr *ap_bssid = nm_ap_get_address (match_nofreq); const GByteArray *ap_ssid = nm_ap_get_ssid (match_nofreq);