From: Daniel Wagner <[email protected]>
The second argument is not used anymore, let's remove it. The funciton
name doesn't really match to its implementation, so it's also time
to rename it.
---
src/iptables.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/iptables.c b/src/iptables.c
index 9966467..e20c749 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -1685,11 +1685,9 @@ out:
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;
table = g_hash_table_lookup(table_hash, table_name);
if (table != NULL)
@@ -2058,7 +2056,7 @@ int __connman_iptables_new_chain(const char *table_name,
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;
@@ -2072,7 +2070,7 @@ int __connman_iptables_delete_chain(const char
*table_name,
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;
@@ -2086,7 +2084,7 @@ int __connman_iptables_flush_chain(const char *table_name,
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;
@@ -2101,7 +2099,7 @@ int __connman_iptables_change_policy(const char
*table_name,
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;
@@ -2127,7 +2125,7 @@ int __connman_iptables_append(const char *table_name,
if (err < 0)
goto out;
- table = pre_load_table(table_name, NULL);
+ table = get_table(table_name);
if (table == NULL) {
err = -EINVAL;
goto out;
@@ -2170,7 +2168,7 @@ int __connman_iptables_delete(const char *table_name,
if (err < 0)
goto out;
- table = pre_load_table(table_name, NULL);
+ table = get_table(table_name);
if (table == NULL) {
err = -EINVAL;
goto out;
@@ -2262,7 +2260,7 @@ void flush_table(const char *name)
GSList *chains = NULL, *list;
struct connman_iptables *table;
- table = pre_load_table(name, NULL);
+ table = get_table(name);
if (table == NULL)
return;
--
1.8.1.3.566.gaa39828
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman