summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2022-07-29 00:03:20 +0200
committerLubomir Rintel <lkundrak@v3.sk>2022-07-29 13:07:34 +0200
commita3ce5aa50ee0c64ff1488a56c8dbb8affdb1fc48 (patch)
tree669f1626994cb5d3371b34f188f61b40b0d95a5a
parent2b4b4193be5c1fbacc6728dd93452e908e4b25b0 (diff)
downloadNetworkManager-a3ce5aa50ee0c64ff1488a56c8dbb8affdb1fc48.tar.gz
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. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1317
-rw-r--r--src/nmcli/common.c2
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))