Re: [RFC] iptables-test: Add dump command

2013-03-12 Thread Tomasz Bursztyka
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

[PATCH v6 00/14] iptables refactoring

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de Hi, I added two new patches in this version: iptables: Add __connman_iptables_dump() This one is needed to get iptables-test -L working. The good news is that the additinonal function should not add more code to the connman binary since

[PATCH v6 01/14] test-iptables: Move file to tools and rename it to iptables-unit

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de Unit tests are suppessed to be run during 'make distcheck' but iptables-unit needs to be run with root rights. --- Makefile.am | 10 +- tools/iptables-unit.c | 327 ++ unit/test-iptables.c

[PATCH v6 03/14] test-ippool: Run it during make distcheck

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de test-ippool is a pure unit test can therefore be part of the distcheck target. --- Makefile.am | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8721123..003f971 100644 ---

[PATCH v6 04/14] iptables: Add __connman_iptables_dump()

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de In order to allow our test tool iptables-tests to dump a table we need an dump function. The only user will be this tool. That allows the linker to remove this code, so no additional code size. --- src/connman.h | 1 + src/iptables.c | 15

[PATCH v6 05/14] iptables-test: Use iptables implementation from core

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de With the recent changes to iptables.c and the new API iptables-test.c and iptables.c started to diverge and it is not really possible to keep those two files in sync. Instead we start using the new API. Unfortunatly, we need to partially parse argv

[PATCH v6 06/14] iptables-unit: Add debug option

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de It is impossible to see the normal unit test output with all DBG() enabled by default. --- tools/iptables-unit.c | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/tools/iptables-unit.c

[PATCH v6 07/14] iptables-unit: Check if rules are inserted/removed

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de Instead just relying on the error code return by ConnMan's iptables API we use iptables-save to check if the rules either are installed or removed. --- Makefile.am | 2 + configure.ac | 6 +++ tools/iptables-unit.c | 112

[PATCH v6 08/14] iptables: Drop support for xtables 1.4.11

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de The API changed between 1.4.10 (version code 5) and 1.4.11 (version code 6) and we needed to workaround with a bunch of ugly ifdefs. 1.4.11 was released on 26.05.2011 and even Debian testing ships 1.4.14 these days. --- configure.ac | 2 +-

[PATCH v6 09/14] iptables: Use glib function for string operations

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de Streamline this file with the rest of ConnMan's code base. --- src/iptables.c | 62 +- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/iptables.c b/src/iptables.c index

[PATCH v6 10/14] iptables: Lookup in table hash before module loading

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de pre_load_table() is called always with table == NULL, we end up keep trying to load the kernel modules even though the table is already loaded. Therefore, move the lookup one level up. --- src/iptables.c | 24 ++-- 1 file

[PATCH v6 11/14] iptables: Improve debug log output

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de We need to see a bit more in detail what happens when CONNMAN_IPTABLES_DEBUG is not set, for example the removing/flushing during bootup. Also remove the DBG() from parse_rule_spec() because all callers already have a DBG(). So not much additional

[PATCH v6 12/14] iptables: Rename pre_load_table() to get_table()

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de 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 | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-)

[PATCH v6 13/14] iptables: Factor out duplicated update hook code

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de After removing one or more rules the builtin hooks need to be updated accordingly. iptables_flush_chain() and iptables_delete_rule() share a common code part. --- src/iptables.c | 66 -- 1 file

[PATCH v6 14/14] iptables: Allocated memory blocks are already zerod out

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de entry_head and entry_return are allocated via g_try_malloc0(). --- src/iptables.c | 4 1 file changed, 4 deletions(-) diff --git a/src/iptables.c b/src/iptables.c index 96a575c..0f4e207 100644 --- a/src/iptables.c +++ b/src/iptables.c @@

Re: [PATCH v6 00/14] iptables refactoring

2013-03-12 Thread Tomasz Bursztyka
Hi Daniel, ACK from me :) Tomasz ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman

Re: Ethernet Provisioning

2013-03-12 Thread Jack Mitchell
On 11/03/13 16:03, Jukka Rissanen wrote: On 11.03.2013 17:53, Jack Mitchell wrote: On 11/03/13 15:38, Jukka Rissanen wrote: Hi Jack, On 11.03.2013 17:06, Jack Mitchell wrote: I am attempting to use Ethernet provisioning to fulfil my use case, and I'm struggling. My setup is as follows:

Re: Ethernet Provisioning

2013-03-12 Thread Jukka Rissanen
On 12.03.2013 12:17, Jack Mitchell wrote: On 11/03/13 16:03, Jukka Rissanen wrote: wanted to come out of provisioning and into user configured how would I do that? Remove the provisioning file and then make setting changes? Yes Is it valid to manipulate the .config live? I see changing the

[PATCH] build: Ignore iptables-unit and session-test in tools directory

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8dd554d..4dc9c89 100644 --- a/.gitignore +++ b/.gitignore @@ -47,15 +47,15 @@ tools/wpad-test tools/resolv-test tools/polkit-test

[PATCH] service: User cannot modify immutable service

2013-03-12 Thread Jukka Rissanen
If the service is provisioned via .config file, then user is only able to set the AutoConnect status of the service. All the other settings must be set from the .config file. Fixes BMC#25984 --- Hi, this issue was report for provisioned ethernet service but the same problem was also present for

Re: [PATCH v6 13/14] iptables: Factor out duplicated update hook code

2013-03-12 Thread Daniel Wagner
On 03/12/2013 10:45 AM, Daniel Wagner wrote: From: Daniel Wagner daniel.wag...@bmw-carit.de After removing one or more rules the builtin hooks need to be updated accordingly. iptables_flush_chain() and iptables_delete_rule() share a common code part. --- src/iptables.c | 66

Re: Ethernet Provisioning

2013-03-12 Thread Jack Mitchell
On 12/03/13 11:52, Jukka Rissanen wrote: On 12.03.2013 12:17, Jack Mitchell wrote: On 11/03/13 16:03, Jukka Rissanen wrote: wanted to come out of provisioning and into user configured how would I do that? Remove the provisioning file and then make setting changes? Yes Is it valid to

[PATCH v7 00/16] iptables refactoring

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de Hi, There are only two small changes in v7. I think this should now be the final version. I am testing it also with the firewall.c code on top of it and it looks pretty good right now. If possible I would like to see this version now applied :)

[PATCH v7 01/16] test-iptables: Move file to tools and rename it to iptables-unit

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de Unit tests are suppessed to be run during 'make distcheck' but iptables-unit needs to be run with root rights. --- Makefile.am | 10 +- tools/iptables-unit.c | 327 ++ unit/test-iptables.c

[PATCH v7 05/16] iptables: Add __connman_iptables_dump()

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de In order to allow our test tool iptables-tests to dump a table we need an dump function. The only user will be this tool. That allows the linker to remove this code, so no additional code size. --- src/connman.h | 1 + src/iptables.c | 15

[PATCH v7 08/16] iptables-unit: Check if rules are inserted/removed

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de Instead just relying on the error code return by ConnMan's iptables API we use iptables-save to check if the rules either are installed or removed. --- Makefile.am | 2 + configure.ac | 6 +++ tools/iptables-unit.c | 112

[PATCH v7 07/16] iptables-unit: Add debug option

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de It is impossible to see the normal unit test output with all DBG() enabled by default. --- tools/iptables-unit.c | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/tools/iptables-unit.c

[PATCH v7 10/16] iptables: Use glib function for string operations

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de Streamline this file with the rest of ConnMan's code base. --- src/iptables.c | 62 +- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/iptables.c b/src/iptables.c index

[PATCH v7 11/16] iptables: Lookup in table hash before module loading

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de pre_load_table() is called always with table == NULL, we end up keep trying to load the kernel modules even though the table is already loaded. Therefore, move the lookup one level up. --- src/iptables.c | 24 ++-- 1 file

[PATCH v7 09/16] iptables: Drop support for xtables 1.4.11

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de The API changed between 1.4.10 (version code 5) and 1.4.11 (version code 6) and we needed to workaround with a bunch of ugly ifdefs. 1.4.11 was released on 26.05.2011 and even Debian testing ships 1.4.14 these days. --- configure.ac | 2 +-

[PATCH v7 12/16] iptables: Improve debug log output

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de We need to see a bit more in detail what happens when CONNMAN_IPTABLES_DEBUG is not set, for example the removing/flushing during bootup. Also remove the DBG() from parse_rule_spec() because all callers already have a DBG(). So not much additional

[PATCH v7 14/16] iptables: Fix invalid access to list after removing first rule

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de The list pointer is invalid after remove_table_entry(). Since we entering the 'if' body only for the first rule in a builtin chain we can safely update list to point to the next element. --- src/iptables.c | 22 -- 1 file

[PATCH v7 13/16] iptables: Rename pre_load_table() to get_table()

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de 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 | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-)

[PATCH v7 15/16] iptables: Factor out duplicated update hook code

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de After removing one or more rules the builtin hooks need to be updated accordingly. iptables_flush_chain() and iptables_delete_rule() share a common code part. --- src/iptables.c | 60 ++ 1 file

[PATCH v7 16/16] iptables: Allocated memory blocks are already zerod out

2013-03-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de entry_head and entry_return are allocated via g_try_malloc0(). --- src/iptables.c | 4 1 file changed, 4 deletions(-) diff --git a/src/iptables.c b/src/iptables.c index e4935b2..1fd6c42 100644 --- a/src/iptables.c +++ b/src/iptables.c @@