mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 07:18:03 +02: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.
(cherry picked from commit a95ea0eb29)
This commit is contained in:
parent
0a2ed62703
commit
6302cd416d
1 changed files with 12 additions and 14 deletions
|
|
@ -405,14 +405,15 @@ _nmc_mangle_connection(NMDevice * device,
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_config_one(GCancellable * sigterm_cancellable,
|
_config_one(GCancellable * sigterm_cancellable,
|
||||||
NMClient * nmc,
|
NMClient * nmc,
|
||||||
const NMCSProviderGetConfigResult * result,
|
const NMCSProviderGetConfigResult *result,
|
||||||
const char * hwaddr,
|
guint idx)
|
||||||
const NMCSProviderGetConfigIfaceData *config_data)
|
|
||||||
{
|
{
|
||||||
gs_unref_object NMDevice *device = NULL;
|
const NMCSProviderGetConfigIfaceData *config_data = result->iface_datas_arr[idx];
|
||||||
gs_unref_object NMConnection *applied_connection = NULL;
|
const char * hwaddr = config_data->hwaddr;
|
||||||
|
gs_unref_object NMDevice *device = NULL;
|
||||||
|
gs_unref_object NMConnection *applied_connection = NULL;
|
||||||
guint64 applied_version_id;
|
guint64 applied_version_id;
|
||||||
gs_free_error GError *error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
gboolean changed;
|
gboolean changed;
|
||||||
|
|
@ -537,14 +538,11 @@ _config_all(GCancellable * sigterm_cancellable,
|
||||||
NMClient * nmc,
|
NMClient * nmc,
|
||||||
const NMCSProviderGetConfigResult *result)
|
const NMCSProviderGetConfigResult *result)
|
||||||
{
|
{
|
||||||
GHashTableIter h_iter;
|
gboolean any_changes = FALSE;
|
||||||
const NMCSProviderGetConfigIfaceData *c_config_data;
|
guint i;
|
||||||
const char * c_hwaddr;
|
|
||||||
gboolean any_changes = FALSE;
|
|
||||||
|
|
||||||
g_hash_table_iter_init(&h_iter, result->iface_datas);
|
for (i = 0; i < result->n_iface_datas; i++) {
|
||||||
while (g_hash_table_iter_next(&h_iter, (gpointer *) &c_hwaddr, (gpointer *) &c_config_data)) {
|
if (_config_one(sigterm_cancellable, nmc, result, i))
|
||||||
if (_config_one(sigterm_cancellable, nmc, result, c_hwaddr, c_config_data))
|
|
||||||
any_changes = TRUE;
|
any_changes = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue