summaryrefslogtreecommitdiff
path: root/src/iptables.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-02-06 15:24:22 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-02-13 12:57:34 +0100
commit598fa96c4b42c0cf39a6683ebecc6f10293ea378 (patch)
treeb4745c55c49edaa8c8618c4a3edd8fd25d30e267 /src/iptables.c
parent1ae45cd1749e69b6d3ae6d5def23b316eebae6db (diff)
downloadconnman-598fa96c4b42c0cf39a6683ebecc6f10293ea378.tar.gz
connman-598fa96c4b42c0cf39a6683ebecc6f10293ea378.tar.bz2
connman-598fa96c4b42c0cf39a6683ebecc6f10293ea378.zip
iptables: Fix rule insertion in a builtin chain
Diffstat (limited to 'src/iptables.c')
-rw-r--r--src/iptables.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/iptables.c b/src/iptables.c
index ed52bf20..80f63ec2 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -696,7 +696,10 @@ static int iptables_insert_rule(struct connman_iptables *table,
if (new_entry == NULL)
return -EINVAL;
- ret = iptables_add_entry(table, new_entry, chain_head->next, builtin);
+ if (builtin == -1)
+ chain_head = chain_head->next;
+
+ ret = iptables_add_entry(table, new_entry, chain_head, builtin);
if (ret < 0)
g_free(new_entry);