diff options
author | Bart De Schuymer <bdschuym@pandora.be> | 2005-08-12 16:47:02 +0000 |
---|---|---|
committer | Bart De Schuymer <bdschuym@pandora.be> | 2005-08-12 16:47:02 +0000 |
commit | 157e0eaabd6ff0455dee6daeb566526ef7cf706c (patch) | |
tree | fb0a4b4e5283806a54553fdede7b68231bb84cc4 /userspace/ebtables2 | |
parent | bb164972f9a8d967c486904371e4410a09b4e6a1 (diff) |
trivial cleanups
Diffstat (limited to 'userspace/ebtables2')
-rw-r--r-- | userspace/ebtables2/libebtc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/userspace/ebtables2/libebtc.c b/userspace/ebtables2/libebtc.c index 3e39512..7774889 100644 --- a/userspace/ebtables2/libebtc.c +++ b/userspace/ebtables2/libebtc.c @@ -869,7 +869,7 @@ void ebt_delete_rule(struct ebt_u_replace *replace, u_e = &(*u_e)->next; /* Remove the rules */ j = nr_deletes; - while(j--) { + while (j--) { u_e2 = *u_e; *u_e = (*u_e)->next; /* Free everything */ @@ -941,8 +941,10 @@ void ebt_change_counters(struct ebt_u_replace *replace, u_e->cnt.pcnt = (*cnt).pcnt; u_e->cnt_surplus.pcnt = 0; } else { +#ifdef EBT_DEBUG if (cc->type != CNT_NORM) ebt_print_bug("cc->type != CNT_NORM"); +#endif u_e->cnt_surplus.pcnt = (*cnt).pcnt; } @@ -950,8 +952,10 @@ void ebt_change_counters(struct ebt_u_replace *replace, u_e->cnt.bcnt = (*cnt).bcnt; u_e->cnt_surplus.bcnt = 0; } else { +#ifdef EBT_DEBUG if (cc->type != CNT_NORM) ebt_print_bug("cc->type != CNT_NORM"); +#endif u_e->cnt_surplus.bcnt = (*cnt).bcnt; } if (cc->type == CNT_NORM || cc->type == CNT_ZERO) @@ -985,8 +989,10 @@ void ebt_zero_counters(struct ebt_u_replace *replace) continue; entries = ebt_nr_to_chain(replace, i); if (!entries) { +#ifdef EBT_DEBUG if (i < NF_BR_NUMHOOKS) ebt_print_bug("i < NF_BR_NUMHOOKS"); +#endif break; } next = entries->entries; @@ -996,7 +1002,6 @@ void ebt_zero_counters(struct ebt_u_replace *replace) } } } else { - next = entries->entries; if (entries->nentries == 0) return; @@ -1019,6 +1024,7 @@ void ebt_zero_counters(struct ebt_u_replace *replace) } cc = cc->next; } + next = entries->entries; while (next) { next->cnt.bcnt = next->cnt.pcnt = 0; next = next->next; |