diff options
author | Dan Williams <dcbw@redhat.com> | 2015-04-06 12:58:47 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2015-04-10 10:17:45 -0500 |
commit | 85aac315c042914a333a99b841095318c1a81e7f (patch) | |
tree | 56ffe63ab8a862e2330302276a7b7647b8bd5eb0 /src/devices/wifi/nm-wifi-ap.c | |
parent | f191e204ace3bb5ebcadd03e275e919561e6680a (diff) | |
download | NetworkManager-85aac315c042914a333a99b841095318c1a81e7f.tar.gz |
wifi: always strict-match access points when merging
The only reason to allow lazy matching was to update a fake
current AP when its real scan result comes in. Now that NM
tracks the current AP based on the the supplicant's current
BSS, a fake current AP will be replaced when the real scan
result arrives. So it's pointless to update the fake one
when it'll just be removed soon.
Diffstat (limited to 'src/devices/wifi/nm-wifi-ap.c')
-rw-r--r-- | src/devices/wifi/nm-wifi-ap.c | 50 |
1 files changed, 7 insertions, 43 deletions
diff --git a/src/devices/wifi/nm-wifi-ap.c b/src/devices/wifi/nm-wifi-ap.c index ae318b0197..107cac77ed 100644 --- a/src/devices/wifi/nm-wifi-ap.c +++ b/src/devices/wifi/nm-wifi-ap.c @@ -1190,31 +1190,8 @@ nm_ap_complete_connection (NMAccessPoint *self, error); } -static gboolean -capabilities_compatible (NM80211ApSecurityFlags a_flags, NM80211ApSecurityFlags b_flags) -{ - if (a_flags == b_flags) - return TRUE; - - /* Make sure there's a common key management method */ - if (!((a_flags & 0x300) & (b_flags & 0x300))) - return FALSE; - - /* Ensure common pairwise ciphers */ - if (!((a_flags & 0xF) & (b_flags & 0xF))) - return FALSE; - - /* Ensure common group ciphers */ - if (!((a_flags & 0xF0) & (b_flags & 0xF0))) - return FALSE; - - return TRUE; -} - NMAccessPoint * -nm_ap_match_in_hash (NMAccessPoint *find_ap, - GHashTable *hash, - gboolean strict_match) +nm_ap_match_in_hash (NMAccessPoint *find_ap, GHashTable *hash) { GHashTableIter iter; NMAccessPoint *list_ap; @@ -1243,8 +1220,7 @@ nm_ap_match_in_hash (NMAccessPoint *find_ap, continue; /* BSSID match */ - if ( (strict_match || nm_ethernet_address_is_valid (find_addr, -1)) - && nm_ethernet_address_is_valid (list_addr, -1) + if ( nm_ethernet_address_is_valid (list_addr, -1) && !nm_utils_hwaddr_matches (list_addr, -1, find_addr, -1)) continue; @@ -1260,23 +1236,11 @@ nm_ap_match_in_hash (NMAccessPoint *find_ap, if (nm_ap_get_flags (list_ap) != nm_ap_get_flags (find_ap)) continue; - if (strict_match) { - if (nm_ap_get_wpa_flags (list_ap) != nm_ap_get_wpa_flags (find_ap)) - continue; - - if (nm_ap_get_rsn_flags (list_ap) != nm_ap_get_rsn_flags (find_ap)) - continue; - } else { - NM80211ApSecurityFlags list_wpa_flags = nm_ap_get_wpa_flags (list_ap); - NM80211ApSecurityFlags find_wpa_flags = nm_ap_get_wpa_flags (find_ap); - NM80211ApSecurityFlags list_rsn_flags = nm_ap_get_rsn_flags (list_ap); - NM80211ApSecurityFlags find_rsn_flags = nm_ap_get_rsn_flags (find_ap); - - /* Just ensure that there is overlap in the capabilities */ - if ( !capabilities_compatible (list_wpa_flags, find_wpa_flags) - && !capabilities_compatible (list_rsn_flags, find_rsn_flags)) - continue; - } + if (nm_ap_get_wpa_flags (list_ap) != nm_ap_get_wpa_flags (find_ap)) + continue; + + if (nm_ap_get_rsn_flags (list_ap) != nm_ap_get_rsn_flags (find_ap)) + continue; return list_ap; } |