mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 10:20:14 +01:00
cloud-setup: process iface-datas in sorted order
The routes/rules that are configured are independent of the order in which we process the devices. That is, because they use the "iface_idx" for cases where there is ambiguity. Still, it feels nicer to always process them in a defined order.
This commit is contained in:
parent
1c5cb9d3c2
commit
a95ea0eb29
1 changed files with 12 additions and 14 deletions
|
|
@ -405,14 +405,15 @@ _nmc_mangle_connection(NMDevice * device,
|
|||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
_config_one(GCancellable * sigterm_cancellable,
|
||||
NMClient * nmc,
|
||||
const NMCSProviderGetConfigResult * result,
|
||||
const char * hwaddr,
|
||||
const NMCSProviderGetConfigIfaceData *config_data)
|
||||
_config_one(GCancellable * sigterm_cancellable,
|
||||
NMClient * nmc,
|
||||
const NMCSProviderGetConfigResult *result,
|
||||
guint idx)
|
||||
{
|
||||
gs_unref_object NMDevice *device = NULL;
|
||||
gs_unref_object NMConnection *applied_connection = NULL;
|
||||
const NMCSProviderGetConfigIfaceData *config_data = result->iface_datas_arr[idx];
|
||||
const char * hwaddr = config_data->hwaddr;
|
||||
gs_unref_object NMDevice *device = NULL;
|
||||
gs_unref_object NMConnection *applied_connection = NULL;
|
||||
guint64 applied_version_id;
|
||||
gs_free_error GError *error = NULL;
|
||||
gboolean changed;
|
||||
|
|
@ -537,14 +538,11 @@ _config_all(GCancellable * sigterm_cancellable,
|
|||
NMClient * nmc,
|
||||
const NMCSProviderGetConfigResult *result)
|
||||
{
|
||||
GHashTableIter h_iter;
|
||||
const NMCSProviderGetConfigIfaceData *c_config_data;
|
||||
const char * c_hwaddr;
|
||||
gboolean any_changes = FALSE;
|
||||
gboolean any_changes = FALSE;
|
||||
guint i;
|
||||
|
||||
g_hash_table_iter_init(&h_iter, result->iface_datas);
|
||||
while (g_hash_table_iter_next(&h_iter, (gpointer *) &c_hwaddr, (gpointer *) &c_config_data)) {
|
||||
if (_config_one(sigterm_cancellable, nmc, result, c_hwaddr, c_config_data))
|
||||
for (i = 0; i < result->n_iface_datas; i++) {
|
||||
if (_config_one(sigterm_cancellable, nmc, result, i))
|
||||
any_changes = TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue