From 0065bd66431a11ca0fd81517d686b421600933ae Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 1 Nov 2013 12:13:23 -0400 Subject: [PATCH] ifcfg-rh: fix handling of runtime NM_CONTROLLED=yes -> no changes We were accidentally removing the connection from priv->connections (and thus from unmanaged-specs) when NM_CONTROLLED changed to no when rereading a changed connection file. --- src/settings/plugins/ifcfg-rh/plugin.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c index 21670fb435..64591e01ce 100644 --- a/src/settings/plugins/ifcfg-rh/plugin.c +++ b/src/settings/plugins/ifcfg-rh/plugin.c @@ -233,6 +233,7 @@ connection_new_or_changed (SCPluginIfcfg *self, NMIfcfgConnection *existing, char **out_old_path) { + SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self); NMIfcfgConnection *new; GError *error = NULL; gboolean ignore_error = FALSE; @@ -315,7 +316,13 @@ connection_new_or_changed (SCPluginIfcfg *self, /* Remove the path so that claim_connection() doesn't complain later when * interface gets managed and connection is re-added. */ nm_connection_set_path (NM_CONNECTION (existing), NULL); - g_object_unref (existing); + + /* signal_remove() will end up removing the connection from our hash, + * so add it back now. + */ + g_hash_table_insert (priv->connections, + g_strdup (nm_connection_get_uuid (NM_CONNECTION (existing))), + existing); } } else { if (old_unmanaged) { /* now managed */