From 151dbe10b1cda511fb8cf8e41e4baa292563ff8a Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 12 Dec 2016 14:10:23 +0100 Subject: [PATCH 1/2] manager: don't update the manager state in get_property() The manager state is already computed every time an active connection changes state, it is not necessary to call nm_manager_update_state() also when the property is read. Moreover, nm_manager_update_state() emits a "notify::state" signal which causes a re-read of the property by the nm-exported-object, resulting in a nested execution of nm_manager_update_state(). (cherry picked from commit 4cc45ee291e78a58e3a69c6f21fe09d61781f591) --- src/nm-manager.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index ad1e48e85e..a9a44ea5ef 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -5655,7 +5655,6 @@ get_property (GObject *object, guint prop_id, g_value_set_string (value, VERSION); break; case PROP_STATE: - nm_manager_update_state (self); g_value_set_uint (value, priv->state); break; case PROP_STARTUP: From c7167c90888333da67a66a3be70f69d14b8c5110 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 12 Dec 2016 14:34:21 +0100 Subject: [PATCH 2/2] manager: don't upgrade the state when connectivity check fails If a connection is ACTIVATED and another one is ACTIVATING but there is no global connectivity, we currently set the manager state to CONNECTING and start a connectivity check to verify whether the manager state can be promoted to CONNECTED_GLOBAL. If this connectivity check fails, we shouldn't promote a CONNECTING state to CONNECTED_SITE. Fixes: 084da69a305be740b5e3cd3e6d3a9a827657a81d (cherry picked from commit 7375822c9502913a6e3c4cb150036792c67908b9) --- src/nm-manager.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index a9a44ea5ef..bdc1c10f01 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -746,9 +746,7 @@ checked_connectivity (GObject *object, GAsyncResult *result, gpointer user_data) if (connectivity == NM_CONNECTIVITY_FULL) set_state (manager, NM_STATE_CONNECTED_GLOBAL); - else if ( connectivity == NM_CONNECTIVITY_PORTAL - || connectivity == NM_CONNECTIVITY_LIMITED) - set_state (manager, NM_STATE_CONNECTED_SITE); + _notify (manager, PROP_CONNECTIVITY); }