mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 04:50:30 +01:00
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:
parent
17082a868e
commit
81d12f020a
1 changed files with 4 additions and 5 deletions
|
|
@ -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) */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue