return err;
}
-static struct connman_iptables *pre_load_table(const char *table_name,
- struct connman_iptables *table)
+static struct connman_iptables *get_table(const char *table_name)
{
- if (table != NULL)
- return table;
+ struct connman_iptables *table;
if (table_name == NULL)
table_name = "filter";
DBG("-t %s -L", table_name);
- table = pre_load_table(table_name, NULL);
+ table = get_table(table_name);
if (table == NULL)
return -EINVAL;
DBG("-t %s -N %s", table_name, chain);
- table = pre_load_table(table_name, NULL);
+ table = get_table(table_name);
if (table == NULL)
return -EINVAL;
DBG("-t %s -X %s", table_name, chain);
- table = pre_load_table(table_name, NULL);
+ table = get_table(table_name);
if (table == NULL)
return -EINVAL;
DBG("-t %s -F %s", table_name, chain);
- table = pre_load_table(table_name, NULL);
+ table = get_table(table_name);
if (table == NULL)
return -EINVAL;
DBG("-t %s -F %s", table_name, chain);
- table = pre_load_table(table_name, NULL);
+ table = get_table(table_name);
if (table == NULL)
return -EINVAL;
if (err < 0)
goto out;
- table = pre_load_table(table_name, NULL);
+ table = get_table(table_name);
if (table == NULL) {
err = -EINVAL;
goto out;
if (err < 0)
goto out;
- table = pre_load_table(table_name, NULL);
+ table = get_table(table_name);
if (table == NULL) {
err = -EINVAL;
goto out;
GSList *chains = NULL, *list;
struct connman_iptables *table;
- table = pre_load_table(name, NULL);
+ table = get_table(name);
if (table == NULL)
return;