Skip to content
This repository has been archived by the owner on Dec 11, 2018. It is now read-only.

Commit

Permalink
Fix counter update bug
Browse files Browse the repository at this point in the history
Fixes a bug that caused the chain counter to stop advancing when it hit
the first non-empty chain.
  • Loading branch information
James C Sinclair committed Nov 29, 2011
1 parent 5e201c0 commit 29221fe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions communication.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,14 @@ void ebt_deliver_counters(struct ebt_u_replace *u_repl)
old = u_repl->counters;
new = newcounters;
while (cc != u_repl->cc) {
if (!next || next == entries->entries) {
while (chainnr < u_repl->num_chains && (!(entries = u_repl->chains[chainnr]) ||
(next = entries->entries->next) == entries->entries))
chainnr++;
if (chainnr == u_repl->num_chains)
break;
while (!next || (next == entries->entries && chainnr < u_repl->num_chains)) {
next = NULL;
if ((entries = u_repl->chains[chainnr++])) {
next = entries->entries->next;
}
}
if (chainnr >= u_repl->num_chains && (!entries || next == entries->entries))
break;
if (next == NULL)
ebt_print_bug("next == NULL");
if (cc->type == CNT_NORM) {
Expand Down

0 comments on commit 29221fe

Please sign in to comment.