From 1ae45cd1749e69b6d3ae6d5def23b316eebae6db Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Mon, 6 Feb 2012 15:24:21 +0200 Subject: tools: Fix rule insertion in a builtin chain into iptables-test --- tools/iptables-test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/iptables-test.c b/tools/iptables-test.c index b87339aa..feefc535 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); -- cgit v1.2.3