summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-09-23 14:43:42 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-09-29 17:52:59 +0200
commit9b09f76539df38f1780163c939585f1bdfb3271d (patch)
treee31737c4a07cf9ea917d931f8e1baa7771e2edae
parent8c62cb26f0513b99e264a4993ce1c25e8e6470d0 (diff)
downloadconnman-9b09f76539df38f1780163c939585f1bdfb3271d.tar.gz
connman-9b09f76539df38f1780163c939585f1bdfb3271d.tar.bz2
connman-9b09f76539df38f1780163c939585f1bdfb3271d.zip
iptables: Fixing target reference update
-rw-r--r--src/iptables.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/iptables.c b/src/iptables.c
index 3f1a92a0..2a2bc2a2 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -315,10 +315,10 @@ static int iptables_add_entry(struct connman_iptables *table,
entry_before = before->data;
/*
- * We've just insterted a new entry. All references before it
+ * We've just appended/insterted a new entry. All references
* should be bumped accordingly.
*/
- for (list = table->entries; list != before; list = list->next) {
+ for (list = table->entries; list; list = list->next) {
tmp = list->data;
if (!is_jump(tmp))
@@ -326,7 +326,7 @@ static int iptables_add_entry(struct connman_iptables *table,
t = (struct xt_standard_target *)ipt_get_target(tmp->entry);
- if (t->verdict >= entry_before->offset)
+ if (t->verdict > entry_before->offset)
t->verdict += entry->next_offset;
}