summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2022-03-08 12:09:05 +0100
committerLubomir Rintel <lkundrak@v3.sk>2022-03-13 18:23:44 +0100
commit550e3bbdd8f503d7246aa104e00792e768be9f25 (patch)
tree3bf273e0f4915d3aae07a9212e720285eb97ef37
parent422ae6bea6f3dec49eb20f2aa969ab101441641f (diff)
cli: device: color WEP APs differently in "wifi list"
Provide a visual cue suggesting that an attempt to associate with an WEP access point might not work. Whether it actually will work up to the daemon.
-rw-r--r--src/nmcli/devices.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nmcli/devices.c b/src/nmcli/devices.c
index f3da212d31..2bfc4cece3 100644
--- a/src/nmcli/devices.c
+++ b/src/nmcli/devices.c
@@ -1237,6 +1237,9 @@ compare_aps(gconstpointer a, gconstpointer b, gpointer user_data)
NMAccessPoint *apa = *(NMAccessPoint **) a;
NMAccessPoint *apb = *(NMAccessPoint **) b;
+ /* Sort the deprecated WEP connections last. */
+ NM_CMP_DIRECT(_ap_is_wep(apb), _ap_is_wep(apa));
+
NM_CMP_DIRECT(nm_access_point_get_strength(apb), nm_access_point_get_strength(apa));
NM_CMP_DIRECT(nm_access_point_get_frequency(apa), nm_access_point_get_frequency(apb));
NM_CMP_DIRECT(nm_access_point_get_max_bitrate(apb), nm_access_point_get_max_bitrate(apa));
@@ -1382,6 +1385,8 @@ fill_output_access_point(NMAccessPoint *ap, const APInfo *info)
/* Set colors */
color = wifi_signal_to_color(strength);
+ if (_ap_is_wep(ap))
+ color = NM_META_COLOR_WIFI_DEPRECATED;
set_val_color_all(arr, color);
if (active)
arr[15].color = NM_META_COLOR_CONNECTION_ACTIVATED;