Hi Daniel,

Hi Tomasz,

What do you think about this? Yes I agree the __connman_log_init()
is dirty but we can't really add '-d' because that belongs also
to iptables command set. And enabling __connman_log_init() always
is bit too much in my opinion.

Looks fine to me, iptables-test is a test tool anyway.

I just tried, sure the output is a bit cryptic and verbose compared to real iptables but I think it's fine.
It should help actually to figure out some bugs, if any, in src/iptables.c
And anyway, when testing new rules addition/deletion, dev should always check via the real iptables if everything is correct.

Just 2 comments below:

diff --git a/tools/iptables-test.c b/tools/iptables-test.c
index 95d0af4..bef9251 100644
--- a/tools/iptables-test.c
+++ b/tools/iptables-test.c
@@ -34,6 +34,7 @@ enum iptables_command {
        IPTABLES_COMMAND_POLICY,
        IPTABLES_COMMAND_CHAIN_INSERT,
        IPTABLES_COMMAND_CHAIN_DELETE,
+       IPTABLES_COMMAND_DUMP,
        IPTABLES_COMMAND_UNKNOWN,
  };
@@ -42,11 +43,12 @@ int main(int argc, char *argv[])
        enum iptables_command cmd = IPTABLES_COMMAND_UNKNOWN;
        char *table = NULL, *chain = NULL, *rule = NULL, *tmp;

Fix table so it gets "filter" as a default value. If you run ./iptables-test without -t it should imply that "fitler" table is used. (like with real iptables)
Currently, not using -t makes it segfault on commit.

        int err, c, i;
+       char *debug;

Unused so you can nuke it.

Merge this patch + my comments to your patch 4 and you get my ACK.

Cheers,

Tomasz
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to