iptables-test: Set builtin flag before inserting new entry
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 12 Nov 2010 01:42:06 +0000 (02:42 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 12 Nov 2010 01:42:06 +0000 (02:42 +0100)
tools/iptables-test.c

index 5634eae..e8e9228 100644 (file)
@@ -592,8 +592,8 @@ connman_iptables_add_rule(struct connman_iptables *table, char *chain_name,
        if (head->builtin < 0)
                builtin = -1;
        else if (chain_head == chain_tail->prev) {
-               head->builtin = -1;
                builtin = head->builtin;
+               head->builtin = -1;
        }
 
        return connman_add_entry(table, new_entry, chain_tail->prev, builtin);