summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-02-06 13:24:21 (GMT)
committerSamuel Ortiz <sameo@linux.intel.com>2012-02-13 11:57:34 (GMT)
commit1ae45cd1749e69b6d3ae6d5def23b316eebae6db (patch)
tree28b2413cd9c06e058a23bdf120e5cc34d159d5b0 /tools
parentd62a11b1575d6991f666b62b5201d7b0104aa9a2 (diff)
downloadconnman-1ae45cd1749e69b6d3ae6d5def23b316eebae6db.zip
connman-1ae45cd1749e69b6d3ae6d5def23b316eebae6db.tar.gz
connman-1ae45cd1749e69b6d3ae6d5def23b316eebae6db.tar.bz2
tools: Fix rule insertion in a builtin chain into iptables-test
Diffstat (limited to 'tools')
-rw-r--r--tools/iptables-test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/iptables-test.c b/tools/iptables-test.c
index b87339a..feefc53 100644
--- a/tools/iptables-test.c
+++ b/tools/iptables-test.c
@@ -689,7 +689,10 @@ static int connman_iptables_insert_rule(struct connman_iptables *table,
if (new_entry == NULL)
return -EINVAL;
- ret = connman_add_entry(table, new_entry, chain_head->next, builtin);
+ if (builtin == -1)
+ chain_head = chain_head->next;
+
+ ret = connman_add_entry(table, new_entry, chain_head, builtin);
if (ret < 0)
g_free(new_entry);