From 9b09f76539df38f1780163c939585f1bdfb3271d Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Fri, 23 Sep 2011 14:43:42 +0300 Subject: [PATCH] iptables: Fixing target reference update --- src/iptables.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/iptables.c b/src/iptables.c index 3f1a92a..2a2bc2a 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; } -- 2.7.4