summaryrefslogtreecommitdiffstats
path: root/libiptc
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-06-07 15:04:34 +0200
committerPatrick McHardy <kaber@trash.net>2008-06-07 15:04:34 +0200
commit1f23d3c2544f4329b31804392abc4eff434ba308 (patch)
tree69b8a485e690960f2c9c78a9133a7ac9349f2c2b /libiptc
parentbb9284d153f338b01975344e96c1b8bcde7d82a8 (diff)
libiptc: move variable definitions to head of function
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'libiptc')
-rw-r--r--libiptc/libiptc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index 9463bdbc..d0f51b4a 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -2170,6 +2170,8 @@ int
TC_CREATE_CHAIN(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle)
{
static struct chain_head *c;
+ int capacity;
+ int exceeded;
iptc_fn = TC_CREATE_CHAIN;
@@ -2209,8 +2211,8 @@ TC_CREATE_CHAIN(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle)
* in the buckets. Thus, only rebuild chain index when the
* capacity is exceed with CHAIN_INDEX_INSERT_MAX chains.
*/
- int capacity = (*handle)->chain_index_sz * CHAIN_INDEX_BUCKET_LEN;
- int exceeded = ((((*handle)->num_chains)-capacity));
+ capacity = (*handle)->chain_index_sz * CHAIN_INDEX_BUCKET_LEN;
+ exceeded = ((((*handle)->num_chains)-capacity));
if (exceeded > CHAIN_INDEX_INSERT_MAX) {
debug("Capacity(%d) exceeded(%d) rebuild (chains:%d)\n",
capacity, exceeded, (*handle)->num_chains);