summary refs log tree commit diff
path: root/system-settings/plugins/ifcfg-rh/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'system-settings/plugins/ifcfg-rh/plugin.c')
-rw-r--r--system-settings/plugins/ifcfg-rh/plugin.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c
index 47ce0075..e6dfa5bc 100644
--- a/system-settings/plugins/ifcfg-rh/plugin.c
+++ b/system-settings/plugins/ifcfg-rh/plugin.c
@@ -146,7 +146,7 @@ read_one_connection (SCPluginIfcfg *plugin, const char *filename)
 
 		if (nm_ifcfg_connection_get_unmanaged_spec (connection)) {
 			PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "Ignoring connection '%s' and its "
-			              "device because NM_CONTROLLED was false.", cid);
+			              "device due to NM_CONTROLLED/BRIDGE/VLAN.", cid);
 			g_signal_emit_by_name (plugin, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED);
 		} else {
 			/* Wait for the connection to become unmanaged once it knows the
@@ -164,7 +164,7 @@ read_one_connection (SCPluginIfcfg *plugin, const char *filename)
 			PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "    error: %s",
 			              (error && error->message) ? error->message : "(unknown)");
 		}
-		g_error_free (error);
+		g_clear_error (&error);
 	}
 
 	return connection;
@@ -334,25 +334,25 @@ dir_changed (GFileMonitor *monitor,
 	g_free (path);
 
 	connection = g_hash_table_lookup (priv->connections, name);
-	if (!connection) {
-		do_new = TRUE;
-	} else {
-		switch (event_type) {
-		case G_FILE_MONITOR_EVENT_DELETED:
-			PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name);
-			do_remove = TRUE;
-			break;
-		case G_FILE_MONITOR_EVENT_CREATED:
-		case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
-			/* Update */
+	switch (event_type) {
+	case G_FILE_MONITOR_EVENT_DELETED:
+		PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name);
+		if (connection)
+			handle_connection_remove_or_new (plugin, name, connection, TRUE, FALSE);
+		break;
+	case G_FILE_MONITOR_EVENT_CREATED:
+	case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
+		/* Update */
+		if (!connection)
+			do_new = TRUE;
+		else
 			connection_changed_handler (plugin, name, connection, &do_remove, &do_new);
-			break;
-		default:
-			break;
-		}
-	}
 
-	handle_connection_remove_or_new (plugin, name, connection, do_remove, do_new);
+		handle_connection_remove_or_new (plugin, name, connection, do_remove, do_new);
+		break;
+	default:
+		break;
+	}
 
 	g_free (name);
 }
@@ -544,7 +544,7 @@ impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin,
 	}
 
 	connection = g_hash_table_lookup (priv->connections, in_ifcfg);
-	if (!connection) {
+	if (!connection || nm_ifcfg_connection_get_unmanaged_spec (connection)) {
 		g_set_error (error,
 		             NM_SETTINGS_INTERFACE_ERROR,
 		             NM_SETTINGS_INTERFACE_ERROR_INVALID_CONNECTION,