Commit 063261bc authored by Jussi Laakkonen's avatar Jussi Laakkonen

[connman] Accommodate IPv6 changes in sailfish iptables ext. JB#42674

Add the type variable into each iptables.c function that was changed
when implementing IPv6 support.
parent 51aa719f
......@@ -1075,21 +1075,21 @@ static int iptables_parse_rule(const gchar* table_name, gchar* rule)
case 'A':
DBG("Append to table \"%s\" chain \"%s\" rule: %s",
table_name, argv[1], rule_str->str);
rval = __connman_iptables_append(table_name, argv[1],
rval = __connman_iptables_append(AF_INET, table_name, argv[1],
rule_str->str);
break;
// Insert
case 'I':
DBG("Insert to table \"%s\" chain \"%s\" rule: %s",
table_name, argv[1], rule_str->str);
rval = __connman_iptables_insert(table_name, argv[1],
rval = __connman_iptables_insert(AF_INET, table_name, argv[1],
rule_str->str);
break;
// Delete
case 'D':
DBG("Delete from table \"%s\" chain \"%s\" rule: %s",
table_name, argv[1], rule_str->str);
rval = __connman_iptables_delete(table_name, argv[1],
rval = __connman_iptables_delete(AF_INET, table_name, argv[1],
rule_str->str);
break;
default:
......@@ -1173,7 +1173,7 @@ static int iptables_restore_table(const char *table_name, const char *fpath)
/* Commit fails if there has not been any changes */
if (rules) {
DBG("Added %d rules to table %s", rules, table_name);
rval = __connman_iptables_commit(table_name);
rval = __connman_iptables_commit(AF_INET, table_name);
}
} else {
ERR("iptables_restore_table() %s",
......@@ -1338,7 +1338,7 @@ int connman_iptables_new_chain(const char *table_name,
if (str_has_connman_prefix(chain))
return -EINVAL;
return __connman_iptables_new_chain(table_name, chain);
return __connman_iptables_new_chain(AF_INET, table_name, chain);
}
/*
......@@ -1355,7 +1355,7 @@ int connman_iptables_delete_chain(const char *table_name,
if (str_has_connman_prefix(chain))
return -EINVAL;
return __connman_iptables_delete_chain(table_name, chain);
return __connman_iptables_delete_chain(AF_INET, table_name, chain);
}
int connman_iptables_flush_chain(const char *table_name,
......@@ -1369,7 +1369,7 @@ int connman_iptables_flush_chain(const char *table_name,
if (str_has_connman_prefix(chain))
return -EINVAL;
return __connman_iptables_flush_chain(table_name, chain);
return __connman_iptables_flush_chain(AF_INET, table_name, chain);
}
/*
......@@ -1382,7 +1382,7 @@ int connman_iptables_find_chain(const char *table_name, const char *chain)
DBG("%s %s", table_name, chain);
return __connman_iptables_find_chain(table_name, chain);
return __connman_iptables_find_chain(AF_INET, table_name, chain);
}
int connman_iptables_insert(const char *table_name,
......@@ -1398,7 +1398,7 @@ int connman_iptables_insert(const char *table_name,
if (str_has_connman_prefix(chain) || str_contains_connman(rule_spec))
return -EINVAL;
return __connman_iptables_insert(table_name, chain, rule_spec);
return __connman_iptables_insert(AF_INET, table_name, chain, rule_spec);
}
int connman_iptables_append(const char *table_name,
......@@ -1414,7 +1414,7 @@ int connman_iptables_append(const char *table_name,
if (str_has_connman_prefix(chain) || str_contains_connman(rule_spec))
return -EINVAL;
return __connman_iptables_append(table_name, chain, rule_spec);
return __connman_iptables_append(AF_INET, table_name, chain, rule_spec);
}
int connman_iptables_delete(const char *table_name,
......@@ -1430,7 +1430,7 @@ int connman_iptables_delete(const char *table_name,
if (str_has_connman_prefix(chain) || str_contains_connman(rule_spec))
return -EINVAL;
return __connman_iptables_delete(table_name, chain, rule_spec);
return __connman_iptables_delete(AF_INET, table_name, chain, rule_spec);
}
int connman_iptables_commit(const char *table_name)
......@@ -1440,7 +1440,7 @@ int connman_iptables_commit(const char *table_name)
DBG("%s", table_name);
return __connman_iptables_commit(table_name);
return __connman_iptables_commit(AF_INET, table_name);
}
int connman_iptables_change_policy(const char *table_name,
......@@ -1456,7 +1456,7 @@ int connman_iptables_change_policy(const char *table_name,
if (str_has_connman_prefix(chain))
return -EINVAL;
return __connman_iptables_change_policy(table_name, chain, policy);
return __connman_iptables_change_policy(AF_INET, table_name, chain, policy);
}
const char* connman_iptables_default_save_path(int ip_version)
......
......@@ -302,7 +302,8 @@ void __connman_iptables_cleanup(void)
return;
}
int __connman_iptables_append(const char *table_name,
int __connman_iptables_append(int type,
const char *table_name,
const char *chain,
const char *rule_spec)
{
......@@ -313,7 +314,8 @@ int __connman_iptables_append(const char *table_name,
return 0;
}
int __connman_iptables_insert(const char *table_name,
int __connman_iptables_insert(int type,
const char *table_name,
const char *chain,
const char *rule_spec)
{
......@@ -324,7 +326,8 @@ int __connman_iptables_insert(const char *table_name,
return 0;
}
int __connman_iptables_delete(const char *table_name,
int __connman_iptables_delete(int type,
const char *table_name,
const char *chain,
const char *rule_spec)
{
......@@ -335,7 +338,7 @@ int __connman_iptables_delete(const char *table_name,
return 0;
}
int __connman_iptables_commit(const char *table_name)
int __connman_iptables_commit(int type, const char *table_name)
{
if (!check_table(table_name))
return -1;
......@@ -343,7 +346,8 @@ int __connman_iptables_commit(const char *table_name)
return 0;
}
int __connman_iptables_delete_chain(const char *table_name,
int __connman_iptables_delete_chain(int type,
const char *table_name,
const char *chain)
{
if (!check_table(table_name) || !check_chain(chain))
......@@ -352,7 +356,8 @@ int __connman_iptables_delete_chain(const char *table_name,
return 0;
}
int __connman_iptables_new_chain(const char *table_name,
int __connman_iptables_new_chain(int type,
const char *table_name,
const char *chain)
{
if (!check_table(table_name) || !check_chain(chain))
......@@ -361,7 +366,8 @@ int __connman_iptables_new_chain(const char *table_name,
return 0;
}
int __connman_iptables_flush_chain(const char *table_name,
int __connman_iptables_flush_chain(int type,
const char *table_name,
const char *chain)
{
if (!check_table(table_name) || !check_chain(chain))
......@@ -370,7 +376,8 @@ int __connman_iptables_flush_chain(const char *table_name,
return 0;
}
int __connman_iptables_find_chain(const char *table_name,
int __connman_iptables_find_chain(int type,
const char *table_name,
const char *chain)
{
if (!check_table(table_name) || !check_chain(chain))
......@@ -379,7 +386,8 @@ int __connman_iptables_find_chain(const char *table_name,
return 0;
}
int __connman_iptables_iterate_chains(const char *table_name,
int __connman_iptables_iterate_chains(int type,
const char *table_name,
connman_iptables_iterate_chains_cb_t cb,
void *user_data)
{
......@@ -389,7 +397,8 @@ int __connman_iptables_iterate_chains(const char *table_name,
return 0;
}
int __connman_iptables_change_policy(const char *table_name,
int __connman_iptables_change_policy(int type,
const char *table_name,
const char *chain,
const char *policy)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment