diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2022-07-29 00:03:20 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2022-07-29 00:07:57 +0200 |
commit | 8bdf7eb9a9861d1f63b34c08df11c9d94e5307b7 (patch) | |
tree | 909df61d0e42597e94e732d479bbacc7495c6eca | |
parent | 7864e75e96582d0bac5c56669b2294e8fac473b6 (diff) |
nmcli: do not assume active connection has a settings connection
The reproducer for another problem tripped an assertion failure:
$ nmcli con del act-conn
Connection 'act-conn' (...) successfully deleted.
$ nmcli con down another-conn
(process:94552): nm-CRITICAL **: 17:07:21.170: ((src/libnm-client-impl/nm-remote-connection.c:593)): assertion '<dropped>' failed
Connection 'another-conn' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
$
What happens is that the second invocation, when resolving the
connection name into a NMRemoteConnection object, assumes an active
connection has a settings connection.
This assumption is likely to be wrong immediately after deleting a
connection was active, before giving the active connection enough time
to fully deactivate.
-rw-r--r-- | src/nmcli/common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nmcli/common.c b/src/nmcli/common.c index 509cdc7a53..e6c5c9a0b3 100644 --- a/src/nmcli/common.c +++ b/src/nmcli/common.c @@ -572,7 +572,7 @@ nmc_find_active_connection(const GPtrArray *active_cons, } if (NM_IN_STRSET(filter_type, NULL, "filename")) { - v = nm_remote_connection_get_filename(con); + v = con ? nm_remote_connection_get_filename(con) : NULL; if (complete && (filter_type || *filter_val)) nmc_complete_strings(filter_val, v); if (nm_streq0(filter_val, v)) |