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:
@@ -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);
|
||||
}
|
||||
|
||||
/********************************************************************/
|
||||
|
Reference in New Issue
Block a user