diff options
author | Thomas Haller <thaller@redhat.com> | 2023-11-07 09:28:56 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-11-20 17:36:52 +0100 |
commit | 003ea50540086a6ef31e33a3dd9c081dfbeb9e83 (patch) | |
tree | 377768b73ece5c9ea99d5e22d69694f6e222e2b4 | |
parent | d5cdcfec42ab086e313d8611c5179fb8ea2aadb9 (diff) |
cli: sort `nmcli device` output by active-connection firstth/tmp1
Previously, we first sort by the device's state, then by the active
connection's state. Contrast to `nmcli connection`, which first sorts
by the active connection's state.
It means, the sort order is somewhat different. Fix that.
In most cases, that shouldn't make a difference, because the
device's state and the active-connection's state should
correspond. However, it matters as we now treat external activations
different, and that is tied to the active connection.
(cherry picked from commit 38ad9e52113c03067cbd01fa0a8ee152a8266db1)
-rw-r--r-- | src/nmcli/devices.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nmcli/devices.c b/src/nmcli/devices.c index a56f0f819b..3c280e0320 100644 --- a/src/nmcli/devices.c +++ b/src/nmcli/devices.c @@ -1072,8 +1072,8 @@ compare_devices(const void *a, const void *b) NMActiveConnection *da_ac = nm_device_get_active_connection(da); NMActiveConnection *db_ac = nm_device_get_active_connection(db); - NM_CMP_DIRECT(nm_device_get_state(db), nm_device_get_state(da)); NM_CMP_RETURN(nmc_active_connection_cmp(db_ac, da_ac)); + NM_CMP_DIRECT(nm_device_get_state(db), nm_device_get_state(da)); NM_CMP_DIRECT_STRCMP0(nm_device_get_type_description(da), nm_device_get_type_description(db)); NM_CMP_DIRECT_STRCMP0(nm_device_get_iface(da), nm_device_get_iface(db)); NM_CMP_DIRECT_STRCMP0(nm_object_get_path(NM_OBJECT(da)), nm_object_get_path(NM_OBJECT(db))); |