Skip to content

nmcli: do not assume active connection has a settings connection

Lubomir Rintel requested to merge lr/nmcli-act-con-assert into main

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.

Edited by Lubomir Rintel

Merge request reports