core: list iptables sharing rules in the right order

The rules were added to the list using g_slist_append() and then
applied one at time using "iptables --insert" which puts them at the
beginning of the chain, reversing the initial order.

Instead, list them in the desired order and use g_slist_prepend() to
achieve the same result. This has no functional changes.
This commit is contained in:
Beniamino Galvani
2016-01-21 16:39:55 +01:00
parent ba24a12739
commit 8cba3e046e
2 changed files with 10 additions and 10 deletions

View File

@@ -346,7 +346,7 @@ nm_act_request_add_share_rule (NMActRequest *req,
rule = g_malloc0 (sizeof (ShareRule));
rule->table = g_strdup (table);
rule->rule = g_strdup (table_rule);
priv->share_rules = g_slist_append (priv->share_rules, rule);
priv->share_rules = g_slist_prepend (priv->share_rules, rule);
}
/********************************************************************/