Hi Daniel,
+}
+
+static int chain_to_index(const char *chain_name)
+{
+ if (!strcmp(hooknames[NF_IP_PRE_ROUTING], chain_name))
+ return 0;
+ if (!strcmp(hooknames[NF_IP_LOCAL_IN], chain_name))
+ return 1;
+ if (!strcmp(hooknames[NF_IP_FORWARD], chain_name))
+ return 2;
+ if (!strcmp(hooknames[NF_IP_LOCAL_OUT], chain_name))
+ return 3;
+ if (!strcmp(hooknames[NF_IP_POST_ROUTING], chain_name))
+ return 4;
+ return -1;
}
Return NF_IP_*
static gboolean is_managed_chain(const char *chain_name)
@@ -2328,17 +2348,87 @@ out:
}
int __connman_iptables_managed_append(const char *table_name,
- const char *chain,
+ const char *chain_name,
const char *rule_spec)
{
So as I said, keep __connman_iptables_append() and apply the changes there.
int __connman_iptables_managed_delete(const char *table_name,
- const char *chain,
+ const char *chain_name,
const char *rule_spec)
{
Same here.
+ for (list = managed_tables; list != NULL; list = list->next) {
+ mtable = list->data;
+
+ if (g_strcmp0(mtable->name, table_name) == 0)
+ break;
This g_strcmp0() reminds me you use strcmp() in many places, in previous
patchset. Probably in places where I myself did the same mistake a long
ago. Reviewers (including me) failed here ;)
Tomasz
_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman