From 23cc0bf3353ea43d95a906e27c9881b1b68e2bbe Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 30 Apr 2021 22:35:20 +0200 Subject: [PATCH] manager: fix assertion failure in active_connection_find() Active-connections in the async_op_lst are not guaranteed to have a settings-connection. In particular, the settings-connection for an AddAndActivate() AC is set only after the authorization succeeds. Use the non-asserting variant of the function to fix the following failure: nm_active_connection_get_settings_connection: assertion 'sett_conn' failed 1 _g_log_abort() 2 g_logv() 3 g_log() 4 _nm_g_return_if_fail_warning.constprop.14() 5 nm_active_connection_get_settings_connection() 6 active_connection_find() 7 _get_activatable_connections_filter() 8 nm_settings_get_connections_clone() 9 nm_manager_get_activatable_connections() 10 auto_activate_device_cb() 11 g_idle_dispatch() 12 g_main_context_dispatch() 13 g_main_context_iterate.isra.21() 14 g_main_loop_run() 15 main() Fixes: 33b9fa3a3caf ('manager: Keep volatile/external connections while referenced by async_op_lst') https://bugzilla.redhat.com/show_bug.cgi?id=1933719 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/834 --- src/core/nm-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c index 216dc8d2dd..e866eec0d9 100644 --- a/src/core/nm-manager.c +++ b/src/core/nm-manager.c @@ -1021,7 +1021,7 @@ active_connection_find( NMSettingsConnection *ac_conn; ac = async_op_data->ac_auth.active; - ac_conn = nm_active_connection_get_settings_connection(ac); + ac_conn = _nm_active_connection_get_settings_connection(ac); if (sett_conn && sett_conn != ac_conn) continue; if (uuid && !nm_streq0(uuid, nm_settings_connection_get_uuid(ac_conn)))