cli: use nm_utils_hwaddr_matches() for matching BSSID in wifi_print_aps()

We have a proper implementation for comparing MAC addresses. Don't
reimplement it differently.
This commit is contained in:
Thomas Haller 2020-03-18 11:54:07 +01:00
parent 17082a868e
commit 81d12f020a

View file

@ -2846,14 +2846,13 @@ wifi_print_aps (NMDeviceWifi *wifi,
/* Specific AP requested - list only that */
aps = nm_device_wifi_get_access_points (wifi);
for (i = 0; i < aps->len; i++) {
char *bssid_up;
NMAccessPoint *candidate_ap = g_ptr_array_index (aps, i);
const char *candidate_bssid = nm_access_point_get_bssid (candidate_ap);
bssid_up = g_ascii_strup (bssid_user, -1);
if (!strcmp (bssid_up, candidate_bssid))
if (nm_utils_hwaddr_matches (bssid_user,
-1,
nm_access_point_get_bssid (candidate_ap),
-1))
ap = candidate_ap;
g_free (bssid_up);
}
if (ap) {
/* Add headers (field names) */