]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libiptc: move variable definitions to head of function
authorPatrick McHardy <kaber@trash.net>
Sat, 7 Jun 2008 13:04:34 +0000 (15:04 +0200)
committerPatrick McHardy <kaber@trash.net>
Sat, 7 Jun 2008 13:04:34 +0000 (15:04 +0200)
Signed-off-by: Patrick McHardy <kaber@trash.net>
libiptc/libiptc.c

index 9463bdbc6f586e16e8fca3e4e7fa75129f07f1c9..d0f51b4a05dd74f7f3bd3a63666b1d67e6a6ce4a 100644 (file)
@@ -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);